Comments (4)
@sakhawy I have not looked into this too much but my expectation would be
-
For the drag bar it is simply a matter of CSS: The drag handle is, in fact, a background image on the bar and positioned at the left. There is a rule missing moving it to the right. See line 833. To be on the right side, it would probably be
right center
instead of-1px center
. (Also, I'd preferleft center
to-1px center
. If needed, we can crop the GIF by 1px):
django-cms/cms/static/cms/sass/components/pagetree/_tree.scss
Lines 817 to 835 in 8a0aa59
-
For the dropdown menu, you'll have to think if you can solve it with CSS only. The relevant file is https://github.com/django-cms/django-cms/blob/develop-4/cms/static/cms/sass/components/pagetree/_dropdown.scss. There are two things to do:
- Position the little triangle arrow on the other side of the dropdown. Now, there's three not well-named classes:
.cms-pagetree-dropdown-menu-arrow-top-right
,.cms-pagetree-dropdown-menu-arrow-right-top
, and.cms-pagetree-dropdown-menu-arrow-right-bottom
. Does it make sense to replace the "right" by "side" and change the CSS that it is right for ltr and left for rtl? This might also require some js changes. - Position the dropdown aligned on the other side of the button:
django-cms/cms/static/cms/sass/components/pagetree/_tree.scss
Lines 407 to 410 in 8a0aa59
- Position the little triangle arrow on the other side of the dropdown. Now, there's three not well-named classes:
-
For the dragging I have not had time to look into it.
from django-cms.
Thanks a lot for your helpful comment @fsbraun! I'm currently working on a PR (I'm at point 3 at the moment)
- That was fixed. There's another reason why one might crop the GIF: there are a couple of padding pixels on the left -- I was leaving the decision of cropping it to the PR review.
- I haven't taken a look yet but your approach makes sense. Thanks for the help. I'll get back to this issue if something doesn't make sense.
- I think I have to do this from
cms/static/cms/js/modules/cms.pagetree.js
. If you look at the_tree.scss
file you can see thatright: 3%
is a hack(?). For example, try to resize the window and you'll see a slight change in the marker width relative to the tree container. If I have to do it in CSS then I need to hack my way around the width of the marker. The width of the marker isn't straightforward because jstree injects it into the body instead of the tree container for example.
django-cms/cms/static/cms/sass/components/pagetree/_tree.scss
Lines 1073 to 1104 in 8a0aa59
I'll try to do it from check_callback
.
django-cms/cms/static/cms/js/modules/cms.pagetree.js
Lines 184 to 194 in 8a0aa59
On another note, how do you feel about using CSS logical properties (instead of explicitly setting left & right for example)?
from django-cms.
Logical properties are even better. They keep the CSS smaller.
from django-cms.
So far, 1 is fixed. As for 3, I managed to solve the problem by programmatically adding CSS to #jstree-marker
on the dnd_move.vakata
event -- the only event where this can work:
// styling the #jstree-marker dynamically on dnd_move
var marker = $('#jstree-marker');
var root = $('#changelist');
marker.css({
left: `${root.offset().left}px`,
width: `${root.width()}px`
});
});
I also edited the Sass and added logical properties to the classes I edited.
As I was working on this I noticed another part that needs RTL support (I think it's the grid I haven't looked into it yet):
Is it ok to put all of those fixes in the same PR?
from django-cms.
Related Issues (20)
- [BUG] cannot delete page HOT 10
- [BUG] Model PageUrl should add constraint unique_together HOT 2
- [BUG] Missing translations on 3.11.5 HOT 1
- [BUG] Structure board renders placeholders of wrong language
- [BUG] Unpublished page is shown instead of 404 HOT 13
- [BUG] `CMS_TOOLBAR_HIDE = True` breaks ToolbarMiddleware in v3.11.x HOT 1
- [BUG] Special characters in page title HOT 7
- [BUG] Adding new page ignores setting CMS_DEFAULT_IN_NAVIGATION HOT 1
- [BUG] CMS 4.1 slug is readonly when changing Page title HOT 9
- [DOC] No explanation on using PlaceholderRelationField with classed based views HOT 16
- [BUG] Editing a page sometimes fails HOT 1
- [BUG] Console error in browser when opening PageContentAdmin HOT 1
- [BUG] Add plugin modal not working after migration HOT 1
- [BUG] placeholders-outside-cms TemplateDoesNotExist HOT 6
- [README] Quite a few links in the README lead to a 404
- [BUG] Moved plugins sometimes end at the wrong location HOT 4
- [BUG] manage.py cms fixtree does not repair model PageUrl HOT 1
- [BUG] Window resize event triggers editing mode HOT 9
- [BUG] AppHooked page does not have New draft button HOT 7
- [BUG] PLACEHOLDER_CONF 'default_plugins' functionality removed. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-cms.