Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olecom/6923368 to your computer and use it in GitHub Desktop.
Save olecom/6923368 to your computer and use it in GitHub Desktop.
Ext.ux.BoxReorderer: disable if container overflows
--- 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) {
@olecom
Copy link
Author

olecom commented Apr 10, 2014

updated to ext-5.0.0.736

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment