Skip to content

Commit

Permalink
this removes the use of our own (unreliable) drag delay for floating …
Browse files Browse the repository at this point in the history
…windows.

dojo included with ESRI JS API 3.17+ adds detection for MS Edge browser so
we can use that as a more reliable approach to solving the original issue #379
with dragging floating windows in Internet Explorer and Edge browsers.
  • Loading branch information
tmcgee committed Oct 5, 2016
1 parent 4651249 commit 38a6324
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions viewer/js/gis/dijit/FloatingTitlePane.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ define([
'dojo/dnd/Moveable',
'dojo/aspect',
'dojo/topic',
'dojo/sniff',
'dojo/_base/window',
'dojo/window',
'dojo/dom-geometry',
Expand All @@ -16,7 +17,7 @@ define([
'dojox/layout/ResizeHandle',
'xstyle/css!dojox/layout/resources/ResizeHandle.css',
'xstyle/css!./FloatingTitlePane/css/FloatingTitlePane.css'
], function (declare, TitlePane, on, lang, Moveable, aspect, topic, win, winUtils, domGeom, domStyle, domConstruct, domAttr, domClass, ResizeHandle) {
], function (declare, TitlePane, on, lang, Moveable, aspect, topic, has, win, winUtils, domGeom, domStyle, domConstruct, domAttr, domClass, ResizeHandle) {

return declare([TitlePane], {
sidebarPosition: null,
Expand All @@ -41,8 +42,12 @@ define([
},
startup: function () {
if (this.titleBarNode && this.canFloat) {
if (has('edge') || has('trident')) {
this.dragDelay = 0;
}
this._moveable = new Moveable(this.domNode, {
handle: this.titleBarNode
handle: this.titleBarNode,
delay: this.dragDelay
});
this._titleBarHeight = domStyle.get(this.titleBarNode, 'height');
aspect.after(this._moveable, 'onMove', lang.hitch(this, '_dragging'), true);
Expand Down Expand Up @@ -100,12 +105,7 @@ define([
},

/* Methods for Dragging */
_dragging: function (mover) {
// add our own delay since the movable delay
// property breaks in all versions of Internet Explorer
if (Math.abs(mover.marginBox.l - this._moverBox.l) <= this.dragDelay || Math.abs(mover.marginBox.t - this._moverBox.t) <= this.dragDelay) {
return;
}
_dragging: function () {
this.isDragging = true;
if (!this.titleCursor) {
this.titleCursor = domStyle.get(this.titleBarNode, 'cursor');
Expand Down

0 comments on commit 38a6324

Please sign in to comment.