Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
minor drag improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Jun 6, 2014
1 parent d5e3bdf commit b565a62
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
4 changes: 3 additions & 1 deletion elements/design-canvas/design-canvas.html
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,14 @@
};
dragInfo.drop = function() {
this.dropTarget = this.dropTarget || scope(this.event.relatedTarget);
this.dropTarget.classList.remove('drop-target');
return drop(this);
};
},

drop: function(dragInfo) {
if (this.dropTarget) {
this.dropTarget.classList.remove('drop-target');
}
this.dragInfo = null;
// remove dragging affordances (e.g. absolutely positioned)
this.unsetDraggableStyleRules(dragInfo.element);
Expand Down
12 changes: 8 additions & 4 deletions elements/design-palette/design-palette.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
-ms-user-select: none;
}

core-submenu::shadow #submenu {
margin-left: 24px;
}

.group-item {
font-weight: 500;
}
Expand Down Expand Up @@ -70,13 +74,13 @@
background-color: white;
}

.grid-item > * {
pointer-events: none;
.grid-item > * {
pointer-events: none;
}

img {
vertical-align: middle;
}
vertical-align: middle;
}

[ishidden] {
display: none;
Expand Down
7 changes: 7 additions & 0 deletions elements/designer-element/designer-element.html
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,13 @@
targetFinding = null;
// forward event to designer
this.designer.paletteDrag(event, dragInfo);
// cleanup coordinates
var drag = dragInfo.drag;
dragInfo.drag = function() {
this.event.clientY -= rect.top;
return drag.apply(this, arguments);
}

// cleanup in drop
var drop = dragInfo.drop;
dragInfo.drop = function() {
Expand Down

0 comments on commit b565a62

Please sign in to comment.