Commit 230e91ff authored by radiolips's avatar radiolips Committed by GitHub
Browse files

Merge pull request #640 from troolee/release/v0.3.0

Release/v0.3.0
parents 28ed6fa3 8ea752dd
language: node_js
node_js:
- 5.7.0
- 7.7.2
env:
- CXX=g++-4.8
addons:
......@@ -10,11 +10,12 @@ addons:
packages:
- g++-4.8
before_install:
- npm install -g protractor
- npm install -g protractor@3.3.0
install:
- npm install -g npm@2
- npm install -g grunt-cli
- npm install -g bower
- npm install selenium-webdriver
- bower install
- npm install
- ./node_modules/protractor/bin/webdriver-manager update --standalone
......@@ -25,7 +26,7 @@ before_script:
script:
- npm run build
- npm test
- grunt e2e-test
# - grunt e2e-test
notifications:
slack:
secure: iGLGsYyVIyKVpVVCskGh/zc6Pkqe0D7jpUtbywSbnq6l5seE6bvBVqm0F2FSCIN+AIC+qal2mPEWysDVsLACm5tTEeA8NfL8dmCrAKbiFbi+gHl4mnHHCHl7ii/7UkoIIXNc5UXbgMSXRS5l8UcsSDlN8VxC5zWstbJvjeYIvbA=
......@@ -37,7 +37,8 @@ module.exports = function(grunt) {
copy: {
dist: {
files: {
'dist/gridstack.js': ['src/gridstack.js']
'dist/gridstack.js': ['src/gridstack.js'],
'dist/gridstack.jQueryUI.js': ['src/gridstack.jQueryUI.js'],
}
}
},
......@@ -50,7 +51,9 @@ module.exports = function(grunt) {
},
dist: {
files: {
'dist/gridstack.min.js': ['src/gridstack.js']
'dist/gridstack.min.js': ['src/gridstack.js'],
'dist/gridstack.jQueryUI.min.js': ['src/gridstack.jQueryUI.js'],
'dist/gridstack.all.js': ['src/gridstack.js', 'src/gridstack.jQueryUI.js']
}
}
},
......
The MIT License (MIT)
Copyright (c) 2014-2016 Pavel Reznikov
Copyright (c) 2014-2016 Pavel Reznikov, Dylan Weiss
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......@@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
......@@ -23,8 +23,10 @@ Join gridstack.js on Slack: https://gridstackjs.troolee.com
- [Demo](#demo)
- [Usage](#usage)
- [Requirements](#requirements)
- [Using gridstack.js with jQuery UI](#using-gridstackjs-with-jquery-ui)
- [Install](#install)
- [Basic usage](#basic-usage)
- [Migrating to v0.3.0](#migrating-to-v030)
- [Migrating to v0.2.5](#migrating-to-v025)
- [API Documentation](#api-documentation)
- [Questions and Answers](#questions-and-answers)
......@@ -45,7 +47,7 @@ Join gridstack.js on Slack: https://gridstackjs.troolee.com
- [Using AniJS](#using-anijs)
- [The Team](#the-team)
- [Changes](#changes)
- [v0.2.6 (Development version)](#v027-dev-development-version)
- [v0.3.0 (2017-04-21)](#v030-2017-04-21)
- [v0.2.6 (2016-08-17)](#v026-2016-08-17)
- [v0.2.5 (2016-03-02)](#v025-2016-03-02)
- [v0.2.4 (2016-02-15)](#v024-2016-02-15)
......@@ -72,18 +74,27 @@ Usage
* [lodash.js](https://lodash.com) (>= 3.5.0, full build)
* [jQuery](http://jquery.com) (>= 3.1.0)
* [jQuery UI](http://jqueryui.com) (>= 1.12.0). Minimum required components: Core, Widget, Mouse, Draggable, Resizable
* (Optional) [jquery-ui-touch-punch](https://github.com/furf/jquery-ui-touch-punch) for touch-based devices support
Note: You can still use [underscore.js](http://underscorejs.org) (>= 1.7.0) instead of lodash.js
#### Using gridstack.js with jQuery UI
* [jQuery UI](http://jqueryui.com) (>= 1.12.0). Minimum required components: Core, Widget, Mouse, Draggable, Resizable
* (Optional) [jquery-ui-touch-punch](https://github.com/furf/jquery-ui-touch-punch) for touch-based devices support
## Install
```html
<link rel="stylesheet" href="gridstack.css" />
<script src="gridstack.js"></script>
<script src="gridstack.jQueryUI.js"></script>
```
* Using CDN:
```html
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/gridstack.js/0.2.5/gridstack.min.css" />
<script type="text/javascript" src='//cdnjs.cloudflare.com/ajax/libs/gridstack.js/0.2.5/gridstack.min.js'></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/gridstack.js/0.2.6/gridstack.min.css" />
<script type="text/javascript" src='//cdnjs.cloudflare.com/ajax/libs/gridstack.js/0.2.6/gridstack.min.js'></script>
```
* Using bower:
......@@ -129,6 +140,25 @@ $(function () {
</script>
```
## Migrating to v0.3.0
As of v0.3.0, gridstack introduces a new plugin system. The drag'n'drop functionality has been modified to take advantage of this system. Because of this, and to avoid dependency on core code from jQuery UI, the plugin was functionality was moved to a separate file.
To ensure gridstack continues to work, either include the additional `gridstack.jQueryUI.js` file into your HTML or use `gridstack.all.js`:
```html
<script src="gridstack.js"></script>
<script src="gridstack.jQueryUI.js"></script>
```
or
```html
<script src="gridstack.all.js"></script>
```
We're working on implementing support for other drag'n'drop libraries through the new plugin system.
## Migrating to v0.2.5
As of v0.2.5 all methods and parameters are in camel case to respect [JavaScript Style Guide and Coding Conventions](http://www.w3schools.com/js/js_conventions.asp).
......@@ -171,6 +201,8 @@ $(function () {
});
```
If you're still experiencing issues on touch devices please check [#444](https://github.com/troolee/gridstack.js/issues/444)
## Use with knockout.js
```javascript
......@@ -475,6 +507,21 @@ for help.
Changes
=======
#### v0.3.0 (2017-04-21)
- remove placeholder when dragging widget below grid (already worked when dragging left, above, and to the right of grid).
- prevent extra checks for removing widget when dragging off grid.
- trigger `added` when a widget is added via dropping from one grid to another.
- trigger `removed` when a widget is removed via dropping from one grid to another.
- trigger `removed` when a widget is removed via dropping on a removable zone ([#607](https://github.com/troolee/gridstack.js/issues/607) and [#550])(https://github.com/troolee/gridstack.js/issues/550)).
- trigger custom event for `resizestop` called `gsresizestop` ([#577](https://github.com/troolee/gridstack.js/issues/577) and [#398](https://github.com/troolee/gridstack.js/issues/398)).
- prevent dragging/resizing in `oneColumnMode` ([#593](https://github.com/troolee/gridstack.js/issues/593)).
- add `oneColumnModeClass` option to grid.
- remove 768px CSS styles, moved to grid-stack-one-column-mode class.
- add max-width override on grid-stck-one-column-mode ([#462](https://github.com/troolee/gridstack.js/issues/462)).
- add internal function`isNodeChangedPosition`, minor optimization to move/drag.
- drag'n'drop plugin system. Move jQuery UI dependencies to separate plugin file.
#### v0.2.6 (2016-08-17)
- update requirements to the latest versions of jQuery (v3.1.0+) and jquery-ui (v1.12.0+).
......@@ -575,7 +622,7 @@ License
The MIT License (MIT)
Copyright (c) 2014-2016 Pavel Reznikov
Copyright (c) 2014-2016 Pavel Reznikov, Dylan Weiss
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
{
"name": "gridstack",
"version": "0.2.6",
"version": "0.3.0",
"homepage": "https://github.com/troolee/gridstack.js",
"authors": [
"Pavel Reznikov <pashka.reznikov@gmail.com>"
......
......@@ -20,6 +20,7 @@
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
<script src="../dist/gridstack.js"></script>
<script src="../dist/gridstack.jQueryUI.js"></script>
<style type="text/css">
.grid-stack {
......
......@@ -18,6 +18,7 @@
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
<script src="../dist/gridstack.js"></script>
<script src="../dist/gridstack.jQueryUI.js"></script>
<style type="text/css">
.grid-stack {
......
......@@ -19,6 +19,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.2.0/knockout-min.js"></script>
<script src="../dist/gridstack.js"></script>
<script src="../dist/gridstack.jQueryUI.js"></script>
<style type="text/css">
.grid-stack {
......
......@@ -19,6 +19,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.2.0/knockout-min.js"></script>
<script src="../dist/gridstack.js"></script>
<script src="../dist/gridstack.jQueryUI.js"></script>
<style type="text/css">
.grid-stack {
......
......@@ -18,6 +18,7 @@
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
<script src="../dist/gridstack.js"></script>
<script src="../dist/gridstack.jQueryUI.js"></script>
<style type="text/css">
.grid-stack {
......
......@@ -19,6 +19,7 @@
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
<script src="../dist/gridstack.js"></script>
<script src="../dist/gridstack.jQueryUI.js"></script>
<style type="text/css">
.grid-stack {
......@@ -117,6 +118,5 @@
};
});
</script>
</script>
</body>
</html>
......@@ -19,6 +19,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.2.0/knockout-min.js"></script>
<script src="../dist/gridstack.js"></script>
<script src="../dist/gridstack.jQueryUI.js"></script>
<style type="text/css">
.grid-stack {
......
......@@ -18,6 +18,7 @@
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
<script src="../dist/gridstack.js"></script>
<script src="../dist/gridstack.jQueryUI.js"></script>
<style type="text/css">
.grid-stack {
......
......@@ -19,6 +19,7 @@
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
<script src="../dist/gridstack.js"></script>
<script src="../dist/gridstack.jQueryUI.js"></script>
<style type="text/css">
#grid1 {
......
This diff is collapsed.
This diff is collapsed.
......@@ -369,18 +369,19 @@
transition: left 0s, top 0s, height 0s, width 0s;
}
@media (max-width: 768px) {
.grid-stack-item {
position: relative !important;
width: auto !important;
left: 0 !important;
top: auto !important;
margin-bottom: 20px;
}
.grid-stack-item .ui-resizable-handle {
display: none;
}
.grid-stack {
height: auto !important;
}
.grid-stack.grid-stack-one-column-mode {
height: auto !important;
}
.grid-stack.grid-stack-one-column-mode > .grid-stack-item {
position: relative !important;
width: auto !important;
left: 0 !important;
top: auto !important;
margin-bottom: 20px;
max-width: none !important;
}
.grid-stack.grid-stack-one-column-mode > .grid-stack-item > .ui-resizable-handle {
display: none;
}
/**
* gridstack.js 0.3.0
* http://troolee.github.io/gridstack.js/
* (c) 2014-2016 Pavel Reznikov, Dylan Weiss
* gridstack.js may be freely distributed under the MIT license.
* @preserve
*/
(function(factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery', 'lodash', 'gridstack', 'jquery-ui/data', 'jquery-ui/disable-selection', 'jquery-ui/focusable',
'jquery-ui/form', 'jquery-ui/ie', 'jquery-ui/keycode', 'jquery-ui/labels', 'jquery-ui/jquery-1-7',
'jquery-ui/plugin', 'jquery-ui/safe-active-element', 'jquery-ui/safe-blur', 'jquery-ui/scroll-parent',
'jquery-ui/tabbable', 'jquery-ui/unique-id', 'jquery-ui/version', 'jquery-ui/widget',
'jquery-ui/widgets/mouse', 'jquery-ui/widgets/draggable', 'jquery-ui/widgets/droppable',
'jquery-ui/widgets/resizable'], factory);
} else if (typeof exports !== 'undefined') {
try { jQuery = require('jquery'); } catch (e) {}
try { _ = require('lodash'); } catch (e) {}
try { GridStackUI = require('gridstack'); } catch (e) {}
factory(jQuery, _, GridStackUI);
} else {
factory(jQuery, _, GridStackUI);
}
})(function($, _, GridStackUI) {
var scope = window;
/**
* @class JQueryUIGridStackDragDropPlugin
* jQuery UI implementation of drag'n'drop gridstack plugin.
*/
function JQueryUIGridStackDragDropPlugin(grid) {
GridStackUI.GridStackDragDropPlugin.call(this, grid);
}
GridStackUI.GridStackDragDropPlugin.registerPlugin(JQueryUIGridStackDragDropPlugin);
JQueryUIGridStackDragDropPlugin.prototype = Object.create(GridStackUI.GridStackDragDropPlugin.prototype);
JQueryUIGridStackDragDropPlugin.prototype.constructor = JQueryUIGridStackDragDropPlugin;
JQueryUIGridStackDragDropPlugin.prototype.resizable = function(el, opts) {
el = $(el);
if (opts === 'disable' || opts === 'enable') {
el.resizable(opts);
} else if (opts === 'option') {
var key = arguments[2];
var value = arguments[3];
el.resizable(opts, key, value);
} else {
el.resizable(_.extend({}, this.grid.opts.resizable, {
start: opts.start || function() {},
stop: opts.stop || function() {},
resize: opts.resize || function() {}
}));
}
return this;
};
JQueryUIGridStackDragDropPlugin.prototype.draggable = function(el, opts) {
el = $(el);
if (opts === 'disable' || opts === 'enable') {
el.draggable(opts);
} else {
el.draggable(_.extend({}, this.grid.opts.draggable, {
containment: this.grid.opts.isNested ? this.grid.container.parent() : null,
start: opts.start || function() {},
stop: opts.stop || function() {},
drag: opts.drag || function() {}
}));
}
return this;
};
JQueryUIGridStackDragDropPlugin.prototype.droppable = function(el, opts) {
el = $(el);
if (opts === 'disable' || opts === 'enable') {
el.droppable(opts);
} else {
el.droppable({
accept: opts.accept
});
}
return this;
};
JQueryUIGridStackDragDropPlugin.prototype.isDroppable = function(el, opts) {
el = $(el);
return Boolean(el.data('droppable'));
};
JQueryUIGridStackDragDropPlugin.prototype.on = function(el, eventName, callback) {
$(el).on(eventName, callback);
return this;
};
return JQueryUIGridStackDragDropPlugin;
});
/**
* gridstack.js 0.3.0
* http://troolee.github.io/gridstack.js/
* (c) 2014-2016 Pavel Reznikov, Dylan Weiss
* gridstack.js may be freely distributed under the MIT license.
* @preserve
*/
!function(a){if("function"==typeof define&&define.amd)define(["jquery","lodash","gridstack","jquery-ui/data","jquery-ui/disable-selection","jquery-ui/focusable","jquery-ui/form","jquery-ui/ie","jquery-ui/keycode","jquery-ui/labels","jquery-ui/jquery-1-7","jquery-ui/plugin","jquery-ui/safe-active-element","jquery-ui/safe-blur","jquery-ui/scroll-parent","jquery-ui/tabbable","jquery-ui/unique-id","jquery-ui/version","jquery-ui/widget","jquery-ui/widgets/mouse","jquery-ui/widgets/draggable","jquery-ui/widgets/droppable","jquery-ui/widgets/resizable"],a);else if("undefined"!=typeof exports){try{jQuery=require("jquery")}catch(a){}try{_=require("lodash")}catch(a){}try{GridStackUI=require("gridstack")}catch(a){}a(jQuery,_,GridStackUI)}else a(jQuery,_,GridStackUI)}(function(a,b,c){function d(a){c.GridStackDragDropPlugin.call(this,a)}window;return c.GridStackDragDropPlugin.registerPlugin(d),d.prototype=Object.create(c.GridStackDragDropPlugin.prototype),d.prototype.constructor=d,d.prototype.resizable=function(c,d){if(c=a(c),"disable"===d||"enable"===d)c.resizable(d);else if("option"===d){var e=arguments[2],f=arguments[3];c.resizable(d,e,f)}else c.resizable(b.extend({},this.grid.opts.resizable,{start:d.start||function(){},stop:d.stop||function(){},resize:d.resize||function(){}}));return this},d.prototype.draggable=function(c,d){return c=a(c),"disable"===d||"enable"===d?c.draggable(d):c.draggable(b.extend({},this.grid.opts.draggable,{containment:this.grid.opts.isNested?this.grid.container.parent():null,start:d.start||function(){},stop:d.stop||function(){},drag:d.drag||function(){}})),this},d.prototype.droppable=function(b,c){return b=a(b),"disable"===c||"enable"===c?b.droppable(c):b.droppable({accept:c.accept}),this},d.prototype.isDroppable=function(b,c){return b=a(b),Boolean(b.data("droppable"))},d.prototype.on=function(b,c,d){return a(b).on(c,d),this},d});
//# sourceMappingURL=gridstack.min.map
\ No newline at end of file
/**
* gridstack.js 0.2.6
* gridstack.js 0.3.0
* http://troolee.github.io/gridstack.js/
* (c) 2014-2016 Pavel Reznikov
* (c) 2014-2016 Pavel Reznikov, Dylan Weiss
* gridstack.js may be freely distributed under the MIT license.
* @preserve
*/
(function(factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery', 'lodash', 'jquery-ui/data', 'jquery-ui/disable-selection', 'jquery-ui/focusable',
'jquery-ui/form', 'jquery-ui/ie', 'jquery-ui/keycode', 'jquery-ui/labels', 'jquery-ui/jquery-1-7',
'jquery-ui/plugin', 'jquery-ui/safe-active-element', 'jquery-ui/safe-blur', 'jquery-ui/scroll-parent',
'jquery-ui/tabbable', 'jquery-ui/unique-id', 'jquery-ui/version', 'jquery-ui/widget',
'jquery-ui/widgets/mouse', 'jquery-ui/widgets/draggable', 'jquery-ui/widgets/droppable',
'jquery-ui/widgets/resizable'], factory);
define(['jquery', 'lodash'], factory);
} else if (typeof exports !== 'undefined') {
try { jQuery = require('jquery'); } catch (e) {}
try { _ = require('lodash'); } catch (e) {}
......@@ -124,6 +119,41 @@
Utils.insert_css_rule = obsolete(Utils.insertCSSRule, 'insert_css_rule', 'insertCSSRule');
// jscs:enable requireCamelCaseOrUpperCaseIdentifiers
/**
* @class GridStackDragDropPlugin
* Base class for drag'n'drop plugin.
*/
function GridStackDragDropPlugin(grid) {
this.grid = grid;
}
GridStackDragDropPlugin.registeredPlugins = [];
GridStackDragDropPlugin.registerPlugin = function(pluginClass) {
GridStackDragDropPlugin.registeredPlugins.push(pluginClass);
};
GridStackDragDropPlugin.prototype.resizable = function(el, opts) {
return this;
};
GridStackDragDropPlugin.prototype.draggable = function(el, opts) {
return this;
};
GridStackDragDropPlugin.prototype.droppable = function(el, opts) {
return this;
};
GridStackDragDropPlugin.prototype.isDroppable = function(el) {
return false;
};
GridStackDragDropPlugin.prototype.on = function(el, eventName, callback) {
return this;
};
var idSeq = 0;
var GridStackEngine = function(width, onchange, floatMode, height, items) {
......@@ -351,6 +381,9 @@
};
GridStackEngine.prototype.canMoveNode = function(node, x, y, width, height) {
if (!this.isNodeChangedPosition(node, x, y, width, height)) {
return false;
}
var hasLocked = Boolean(_.find(this.nodes, function(n) { return n.locked; }));
if (!this.height && !hasLocked) {
......@@ -406,7 +439,27 @@
return clone.getGridHeight() <= this.height;
};
GridStackEngine.prototype.isNodeChangedPosition = function(node, x, y, width, height) {
if (typeof x != 'number') { x = node.x; }
if (typeof y != 'number') { y = node.y; }
if (typeof width != 'number') { width = node.width; }
if (typeof height != 'number') { height = node.height; }
if (typeof node.maxWidth != 'undefined') { width = Math.min(width, node.maxWidth); }
if (typeof node.maxHeight != 'undefined') { height = Math.min(height, node.maxHeight); }
if (typeof node.minWidth != 'undefined') { width = Math.max(width, node.minWidth); }
if (typeof node.minHeight != 'undefined') { height = Math.max(height, node.minHeight); }
if (node.x == x && node.y == y && node.width == width && node.height == height) {
return false;
}
return true;
};
GridStackEngine.prototype.moveNode = function(node, x, y, width, height, noPack) {
if (!this.isNodeChangedPosition(node, x, y, width, height)) {
return node;
}
if (typeof x != 'number') { x = node.x; }
if (typeof y != 'number') { y = node.y; }
if (typeof width != 'number') { width = node.width; }
......@@ -429,6 +482,11 @@
node.width = width;
node.height = height;
node.lastTriedX = x;
node.lastTriedY = y;
node.lastTriedWidth = width;
node.lastTriedHeight = height;
node = this._prepareNode(node, resizing);
this._fixCollisions(node);
......@@ -547,9 +605,20 @@
removable: false,
removeTimeout: 2000,
verticalMarginUnit: 'px',
cellHeightUnit: 'px'
cellHeightUnit: 'px',
disableOneColumnMode: opts.disableOneColumnMode || false,
oneColumnModeClass: opts.oneColumnModeClass || 'grid-stack-one-column-mode',
ddPlugin: null
});
if (this.opts.ddPlugin === false) {
this.opts.ddPlugin = GridStackDragDropPlugin;
} else if (this.opts.ddPlugin === null) {
this.opts.ddPlugin = _.first(GridStackDragDropPlugin.registeredPlugins) || GridStackDragDropPlugin;
}
this.dd = new this.opts.ddPlugin(this);
if (this.opts.rtl === 'auto') {
this.opts.rtl = this.container.css('direction') === 'rtl';
}
......@@ -631,11 +700,11 @@
self._updateHeightsOnResize();
}
if (self._isOneColumnMode()) {
if (self._isOneColumnMode() && !self.opts.disableOneColumnMode) {
if (oneColumnMode) {
return;
}
self.container.addClass(self.opts.oneColumnModeClass);
oneColumnMode = true;
self.grid._sortNodes();
......@@ -645,12 +714,8 @@
if (self.opts.staticGrid) {
return;
}
if (node.noMove || self.opts.disableDrag) {
node.el.draggable('disable');
}
if (node.noResize || self.opts.disableResize) {
node.el.resizable('disable');
}
self.dd.draggable(node.el, 'disable');
self.dd.resizable(node.el, 'disable');
node.el.trigger('resize');
});
......@@ -659,6 +724,7 @@
return;
}
self.container.removeClass(self.opts.oneColumnModeClass);
oneColumnMode = false;
if (self.opts.staticGrid) {
......@@ -667,10 +733,10 @@
_.each(self.grid.nodes, function(node) {
if (!node.noMove && !self.opts.disableDrag) {
node.el.draggable('enable');
self.dd.draggable(node.el, 'enable');
}
if (!node.noResize && !self.opts.disableResize) {
node.el.resizable('enable');
self.dd.resizable(node.el, 'enable');
}
node.el.trigger('resize');
......@@ -683,13 +749,13 @@
if (!self.opts.staticGrid && typeof self.opts.removable === 'string') {
var trashZone = $(self.opts.removable);
if (!trashZone.data('droppable