Last active
December 25, 2015 05:19
-
-
Save olecom/6923368 to your computer and use it in GitHub Desktop.
Ext.ux.BoxReorderer: disable if container overflows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- BoxReorderer.js.orig Wed Apr 2 19:15:32 2014 | |
+++ BoxReorderer.js Thu Apr 10 11:58:35 2014 | |
@@ -76,11 +76,13 @@ | |
me.animatePolicy = {}; | |
me.animatePolicy[container.getLayout().names.x] = true; | |
- | |
+ // Disable if overflow | |
+ me.__overflow = false | |
// Initialize the DD on first layout, when the innerCt has been created. | |
me.container.on({ | |
scope: me, | |
+ overflowchange: me.overflowChange, | |
boxready: me.onBoxReady, | |
beforedestroy: me.onContainerDestroy | |
}); | |
@@ -97,6 +99,11 @@ | |
} | |
}, | |
+ overflowChange: function(){ | |
+ //lastHiddenCount, hiddenCount, The, eOpts | |
+ this.__overflow = !!arguments[1]; | |
+ }, | |
+ | |
onBoxReady: function() { | |
var me = this, | |
layout = me.container.getLayout(), | |
@@ -107,7 +114,7 @@ | |
// TODO: Ext5's DD classes should apply config to themselves. | |
// TODO: Ext5's DD classes should not use init internally because it collides with use as a plugin | |
// TODO: Ext5's DD classes should be Observable. | |
- // TODO: When all the above are trus, this plugin should extend the DD class. | |
+ // TODO: When all the above are true, this plugin should extend the DD class. | |
dd = me.dd = new Ext.dd.DD(layout.innerCt, me.container.id + '-reorderer'); | |
Ext.apply(dd, { | |
animate: me.animate, | |
@@ -140,7 +147,7 @@ | |
var cmp = this.getDragCmp(e); | |
// If cmp is null, this expression MUST be coerced to boolean so that createInterceptor is able to test it against false | |
- return !!(cmp && cmp.reorderable !== false); | |
+ return !this.__overflow && !!(cmp && cmp.reorderable !== false); | |
}, | |
onMouseDown: function(e) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
updated to ext-5.0.0.736