-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace goog.fx in sortable directive #3101
Conversation
c7db5d2
to
785ac7b
Compare
To test sortable.js:
I tested debug and compile on Chrome and Firefox (desktop and mobile). Needs more testing on IE, Edge and Safari (especially mobile) |
@@ -0,0 +1,180 @@ | |||
/*! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From where does this file comes from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http://touchpunch.furf.com/
Jquery-ui does not support touch events. Without this patch it won't work on mobile devices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to not using the npm package?
https://www.npmjs.com/package/jquery-ui-touch-punch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My reasoning was to put it to the same place as jquery-ui, since they belong together. We don't use an npm package for jquery-ui either.
The touchpunch code hasn't changed in the last four years, so I don't expect updates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason to don't use the jquery-ui
npm it to have a custom build that's not possible with the npm package...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it.
Makefile
Outdated
-e 's|\.\./third-party/jquery-ui/jquery-ui.min\.css|lib/jquery-ui.min.css|' \ | ||
-e 's|\.\./node_modules/bootstrap/dist/js/bootstrap.js|lib/bootstrap.min.js|' \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the removal of bootstrap.js
wanted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, good catch.
6f6851d
to
92c533e
Compare
In comparaison to https://camptocamp.github.io/ngeo/master/examples/contribs/gmf/apps/desktop:
|
src/directives/sortable.js
Outdated
if (dragListGroup !== null) { | ||
dragListGroup.dispose(); | ||
} | ||
const sortableElement = $(element[0]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: index not need, it can be const sortableElement = $(element);
I'm looking into this.
I never noticed that. I'm going to check where this happened before.
Should be simple, see: http://jqueryui.com/sortable/#placeholder |
Please also add this change: diff --git a/contribs/gmf/less/desktoplayertree.less b/contribs/gmf/less/desktoplayertree.less
index 85077d1..da6741e 100644
--- a/contribs/gmf/less/desktoplayertree.less
+++ b/contribs/gmf/less/desktoplayertree.less
@@ -8,7 +8,6 @@ gmf-layertree {
width: 100%;
ul {
margin-bottom: 0;
- height: 100%;
}
> :first-child {
margin-right: @half-app-margin; It was a workaround for a limitation in goog.fx |
And in addition to limit the axis to |
Axis and containment don't really complement each other. They do, in regards to the layertree, very similar things. Containment has the issue that the layertree parent element is very "tight" and leaves no tolerance. This can make replacing the top layer impossible if you grab the layer handle at the top: Axis has the issue, that you can drag the layer (but not drop) to useless areas above and below the tree: But using neither is worse, because you can get the layertree tab to scroll: I suggest we use the "axis: 'y'"-option. Replacing the top layer comes up often enough. |
yes, go ahead with |
1154fed
to
8c7a85e
Compare
@pfirpfel, what is the status here? Is it ready for merging? |
I'm stuck with a CSS issue. My goal is to collapse the layer group when it gets dragged, like it does with goog.fx. The rules from bootstrap for the regular collapsing(-button) look like this: .collapse {
display: none;
&.in { display: block; }
tr&.in { display: table-row; }
tbody&.in { display: table-row-group; }
} This class gets added to the ul-element inside the li of the layer group. .ui-sortable .gmf-layertree-node.gmf-layertree-dragger {
ul.collapse.in {
display: none;
}
} In Chrome and Firefox it wins against the collapse.in-class, but the effect is different. I think the issue is, that the drag and drop API (HTML5) creates a picture that gets dragged around. So it isn't the actual DOM element. Or at least a ill-timed snapshot of it. As an experiment I removed the .in class (would set display:block) from the element during drag via the drag-event-handlers. This had the same effect as the CSS stuff above. I think I'll leave it as it is. The collapsing is only really necessary on a long list of layergroups. |
Yes @pfirpfel, we will improve in a second step if it is too disturbing with the new way. |
src/directives/sortable.js
Outdated
@@ -1,15 +1,14 @@ | |||
goog.provide('ngeo.SortableOptions'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line can be removed
23f7f64
to
e3d2642
Compare
ffda977
to
8c3f1ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's merge as it, thanks @pfirpfel
contribs/gmf/src/controllers/abstractmobile.js(I'm going to do this in a separate branch/pr)