Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0273bb6

Browse files
trooleeradiolips
authored andcommitted
Update dist. (+14 squashed commits)
Squashed commits: [50607a9] build dist [ff0c00b] Allow negative numbers to be passed to parseHeight function test case fix [3ecc1ca] Allow negative numbers to be passed to parseHeight function test case [d20f670] Allow negative numbers to be passed to parseHeight function fix [0816163] Allow negative numbers to be passed to parseHeight function [aa18c63] rebuild dist [601b5d5] setGridWidth api documentation udpdate [c309856] Add a parameter to setGridWidth method to allow not to propagate resizing to widgets. [ea442d1] drag between grids [50ce614] jqueryui + requirejs note [3d8a8e1] drag between grids demo [446dade] drag from sidebar/between grids [e31d50e] check if element setup before detach [67274f8] trash zone is accepting only widgets
1 parent 0b94492 commit 0273bb6

File tree

8 files changed

+385
-76
lines changed

8 files changed

+385
-76
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Join gridstack.js on Slack: https://gridstackjs.troolee.com
3737
- [Load grid from array](#load-grid-from-array)
3838
- [Override resizable/draggable options](#override-resizabledraggable-options)
3939
- [IE8 support](#ie8-support)
40+
- [Use with require.js](#use-with-requirejs)
4041
- [Nested grids](#nested-grids)
4142
- [Resizing active grid](#resizing-active-grid)
4243
- [Using AniJS](#using-anijs)
@@ -428,6 +429,12 @@ for i in range(N):
428429
There are at least two more issues with gridstack in IE8 with jQueryUI resizable (it seems it doesn't work) and
429430
droppable. If you have any suggestions about support of IE8 you are welcome here: https://github.com/troolee/gridstack.js/issues/76
430431

432+
## Use with require.js
433+
434+
If you're using require.js and a single file jQueryUI please check out this
435+
[Stackoverflow question](http://stackoverflow.com/questions/35582945/redundant-dependencies-with-requirejs) to get it
436+
working properly.
437+
431438

432439
## Nested grids
433440

@@ -472,11 +479,12 @@ Changes
472479
- fix `setStatic` method
473480
- add `setAnimation` method to API
474481
- add `setGridWidth` method ([#227](https://github.com/troolee/gridstack.js/issues/227))
475-
- add `removable`/`removeTimeout`
482+
- add `removable`/`removeTimeout` *(experimental)*
476483
- add `detachGrid` parameter to `destroy` method ([#216](https://github.com/troolee/gridstack.js/issues/216)) (thanks @jhpedemonte)
477484
- add `useOffset` parameter to `getCellFromPixel` method ([#237](https://github.com/troolee/gridstack.js/issues/237))
478485
- add `minWidth`, `maxWidth`, `minHeight`, `maxHeight`, `id` parameters to `addWidget` ([#188](https://github.com/troolee/gridstack.js/issues/188))
479486
- add `added` and `removed` events for when a widget is added or removed, respectively. ([#54](https://github.com/troolee/gridstack.js/issues/54))
487+
- add `acceptWidgets` parameter. Widgets can now be draggable between grids or from outside *(experimental)*
480488

481489
#### v0.2.4 (2016-02-15)
482490

demo/two.html

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,45 @@
4848
margin-bottom: 20px;
4949
background: rgba(255, 0, 0, 0.1) center center url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjY0cHgiIGhlaWdodD0iNjRweCIgdmlld0JveD0iMCAwIDQzOC41MjkgNDM4LjUyOSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3Jvd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2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=) no-repeat;
5050
}
51+
52+
.sidebar {
53+
background: rgba(0, 255, 0, 0.1);
54+
height: 150px;
55+
padding: 25px 0;
56+
text-align: center;
57+
}
58+
59+
.sidebar .grid-stack-item {
60+
width: 200px;
61+
height: 100px;
62+
border: 2px dashed green;
63+
text-align: center;
64+
line-height: 100px;
65+
z-index: 10;
66+
background: rgba(0, 255, 0, 0.1);
67+
cursor: default;
68+
display: inline-block;
69+
}
70+
71+
.sidebar .grid-stack-item .grid-stack-item-content {
72+
background: none;
73+
}
5174
</style>
5275
</head>
5376
<body>
5477
<div class="container-fluid">
5578
<h1>Two grids demo</h1>
5679

57-
<div class="trash">
80+
<div class="row">
81+
<div class="col-md-3">
82+
<div class="sidebar">
83+
<div class="grid-stack-item"><div class="grid-stack-item-content">Drag me</div></div>
84+
</div>
85+
</div>
86+
<div class="col-md-9">
87+
<div class="trash">
88+
</div>
89+
</div>
5890
</div>
5991

6092
<div class="row">
@@ -74,12 +106,15 @@ <h1>Two grids demo</h1>
74106
$(function () {
75107
var options = {
76108
width: 6,
77-
float: true,
109+
float: false,
78110
removable: '.trash',
79-
removeTimeout: 100
111+
removeTimeout: 100,
112+
acceptWidgets: '.grid-stack-item'
80113
};
81114
$('#grid1').gridstack(options);
82-
$('#grid2').gridstack(options);
115+
$('#grid2').gridstack(_.defaults({
116+
float: true
117+
}, options));
83118

84119
var items = [
85120
{x: 0, y: 0, width: 2, height: 2},
@@ -97,6 +132,13 @@ <h1>Two grids demo</h1>
97132
node.x, node.y, node.width, node.height);
98133
}, this);
99134
});
135+
136+
$('.sidebar .grid-stack-item').draggable({
137+
revert: 'invalid',
138+
handle: '.grid-stack-item-content',
139+
scroll: false,
140+
appendTo: 'body'
141+
});
100142
});
101143
</script>
102144
</body>

dist/gridstack.js

Lines changed: 154 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
var height = val;
100100
var heightUnit = 'px';
101101
if (height && _.isString(height)) {
102-
var match = height.match(/^([0-9]*\.[0-9]+|[0-9]+)(px|em|rem|vh|vw)?$/);
102+
var match = height.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw)?$/);
103103
if (!match) {
104104
throw new Error('Invalid height');
105105
}
@@ -477,10 +477,6 @@
477477
opts.placeholderText = opts.placeholder_text;
478478
obsoleteOpts('placeholder_text', 'placeholderText');
479479
}
480-
if (typeof opts.item_class !== 'undefined') {
481-
opts.itemClass = opts.item_class;
482-
obsoleteOpts('item_class', 'itemClass');
483-
}
484480
if (typeof opts.cell_height !== 'undefined') {
485481
opts.cellHeight = opts.cell_height;
486482
obsoleteOpts('cell_height', 'cellHeight');
@@ -576,7 +572,9 @@
576572
var maxHeight = 0;
577573
_.each(nodes, function(n) {
578574
if (n._id === null) {
579-
n.el.remove();
575+
if (n.el) {
576+
n.el.remove();
577+
}
580578
} else {
581579
n.el
582580
.attr('data-gs-x', n.x)
@@ -671,7 +669,9 @@
671669
if (typeof self.opts.removable === 'string') {
672670
var trashZone = $(self.opts.removable);
673671
if (!trashZone.data('droppable')) {
674-
trashZone.droppable({});
672+
trashZone.droppable({
673+
accept: '.' + self.opts.itemClass
674+
});
675675
}
676676
trashZone
677677
.on('dropover', function(event, ui) {
@@ -691,6 +691,114 @@
691691
self._clearRemovingTimeout(el);
692692
});
693693
}
694+
695+
if (self.opts.acceptWidgets) {
696+
var draggingElement = null;
697+
698+
var onDrag = function(event, ui) {
699+
var el = draggingElement;
700+
var node = el.data('_gridstack_node');
701+
var pos = self.getCellFromPixel(ui.offset, true);
702+
var x = Math.max(0, pos.x);
703+
var y = Math.max(0, pos.y);
704+
if (!node._added) {
705+
node._added = true;
706+
707+
node.el = el;
708+
node.x = x;
709+
node.y = y;
710+
self.grid.cleanNodes();
711+
self.grid.beginUpdate(node);
712+
self.grid.addNode(node);
713+
714+
self.container.append(self.placeholder);
715+
self.placeholder
716+
.attr('data-gs-x', node.x)
717+
.attr('data-gs-y', node.y)
718+
.attr('data-gs-width', node.width)
719+
.attr('data-gs-height', node.height)
720+
.show();
721+
node.el = self.placeholder;
722+
node._beforeDragX = node.x;
723+
node._beforeDragY = node.y;
724+
725+
self._updateContainerHeight();
726+
} else {
727+
if (!self.grid.canMoveNode(node, x, y)) {
728+
return;
729+
}
730+
self.grid.moveNode(node, x, y);
731+
self._updateContainerHeight();
732+
}
733+
};
734+
735+
$(self.container).droppable({
736+
accept: function(el) {
737+
el = $(el);
738+
var node = el.data('_gridstack_node');
739+
if (node && node._grid === self) {
740+
return false;
741+
}
742+
return el.is(self.opts.acceptWidgets === true ? '.grid-stack-item' : self.opts.acceptWidgets);
743+
},
744+
over: function(event, ui) {
745+
var offset = self.container.offset();
746+
var el = $(ui.draggable);
747+
var cellWidth = self.cellWidth();
748+
var cellHeight = self.cellHeight();
749+
var origNode = el.data('_gridstack_node');
750+
751+
var width = origNode ? origNode.width : (Math.ceil(el.outerWidth() / cellWidth));
752+
var height = origNode ? origNode.height : (Math.ceil(el.outerHeight() / cellHeight));
753+
754+
draggingElement = el;
755+
756+
var node = self.grid._prepareNode({width: width, height: height, _added: false, _temporary: true});
757+
el.data('_gridstack_node', node);
758+
el.data('_gridstack_node_orig', origNode);
759+
760+
el.on('drag', onDrag);
761+
},
762+
out: function(event, ui) {
763+
var el = $(ui.draggable);
764+
el.unbind('drag', onDrag);
765+
var node = el.data('_gridstack_node');
766+
node.el = null;
767+
self.grid.removeNode(node);
768+
self.placeholder.detach();
769+
self._updateContainerHeight();
770+
el.data('_gridstack_node', el.data('_gridstack_node_orig'));
771+
},
772+
drop: function(event, ui) {
773+
self.placeholder.detach();
774+
775+
var node = $(ui.draggable).data('_gridstack_node');
776+
node._grid = self;
777+
var el = $(ui.draggable).clone(false);
778+
el.data('_gridstack_node', node);
779+
$(ui.draggable).remove();
780+
node.el = el;
781+
self.placeholder.hide();
782+
el
783+
.attr('data-gs-x', node.x)
784+
.attr('data-gs-y', node.y)
785+
.attr('data-gs-width', node.width)
786+
.attr('data-gs-height', node.height)
787+
.addClass(self.opts.itemClass)
788+
.removeAttr('style')
789+
.enableSelection()
790+
.removeData('draggable')
791+
.removeClass('ui-draggable ui-draggable-dragging ui-draggable-disabled')
792+
.unbind('drag', onDrag);
793+
self.container.append(el);
794+
self._prepareElementByNode(el, node);
795+
self._updateContainerHeight();
796+
self._triggerChangeEvent();
797+
798+
self.grid.endUpdate();
799+
}
800+
});
801+
}
694802
};
695803

696804
GridStack.prototype._triggerChangeEvent = function(forceTrigger) {
@@ -840,7 +948,6 @@
840948
};
841949

842950
GridStack.prototype._clearRemovingTimeout = function(el) {
843-
var self = this;
844951
var node = $(el).data('_gridstack_node');
845952

846953
if (!node._removeTimeout) {
@@ -852,30 +959,8 @@
852959
node._isAboutToRemove = false;
853960
};
854961

855-
GridStack.prototype._prepareElement = function(el, triggerAddEvent) {
856-
triggerAddEvent = typeof triggerAddEvent != 'undefined' ? triggerAddEvent : false;
962+
GridStack.prototype._prepareElementByNode = function(el, node) {
857963
var self = this;
858-
el = $(el);
859-
860-
el.addClass(this.opts.itemClass);
861-
var node = self.grid.addNode({
862-
x: el.attr('data-gs-x'),
863-
y: el.attr('data-gs-y'),
864-
width: el.attr('data-gs-width'),
865-
height: el.attr('data-gs-height'),
866-
maxWidth: el.attr('data-gs-max-width'),
867-
minWidth: el.attr('data-gs-min-width'),
868-
maxHeight: el.attr('data-gs-max-height'),
869-
minHeight: el.attr('data-gs-min-height'),
870-
autoPosition: Utils.toBool(el.attr('data-gs-auto-position')),
871-
noResize: Utils.toBool(el.attr('data-gs-no-resize')),
872-
noMove: Utils.toBool(el.attr('data-gs-no-move')),
873-
locked: Utils.toBool(el.attr('data-gs-locked')),
874-
el: el,
875-
id: el.attr('data-gs-id'),
876-
_grid: self
877-
}, triggerAddEvent);
878-
el.data('_gridstack_node', node);
879964

880965
var cellWidth;
881966
var cellHeight;
@@ -962,9 +1047,13 @@
9621047
};
9631048

9641049
var onEndMoving = function(event, ui) {
1050+
var o = $(this);
1051+
if (!o.data('_gridstack_node')) {
1052+
return;
1053+
}
1054+
9651055
var forceNotify = false;
9661056
self.placeholder.detach();
967-
var o = $(this);
9681057
node.el = o;
9691058
self.placeholder.hide();
9701059

@@ -1031,6 +1120,34 @@
10311120
el.attr('data-gs-locked', node.locked ? 'yes' : null);
10321121
};
10331122

1123+
GridStack.prototype._prepareElement = function(el, triggerAddEvent) {
1124+
triggerAddEvent = typeof triggerAddEvent != 'undefined' ? triggerAddEvent : false;
1125+
var self = this;
1126+
el = $(el);
1127+
1128+
el.addClass(this.opts.itemClass);
1129+
var node = self.grid.addNode({
1130+
x: el.attr('data-gs-x'),
1131+
y: el.attr('data-gs-y'),
1132+
width: el.attr('data-gs-width'),
1133+
height: el.attr('data-gs-height'),
1134+
maxWidth: el.attr('data-gs-max-width'),
1135+
minWidth: el.attr('data-gs-min-width'),
1136+
maxHeight: el.attr('data-gs-max-height'),
1137+
minHeight: el.attr('data-gs-min-height'),
1138+
autoPosition: Utils.toBool(el.attr('data-gs-auto-position')),
1139+
noResize: Utils.toBool(el.attr('data-gs-no-resize')),
1140+
noMove: Utils.toBool(el.attr('data-gs-no-move')),
1141+
locked: Utils.toBool(el.attr('data-gs-locked')),
1142+
el: el,
1143+
id: el.attr('data-gs-id'),
1144+
_grid: self
1145+
}, triggerAddEvent);
1146+
el.data('_gridstack_node', node);
1147+
1148+
this._prepareElementByNode(el, node);
1149+
};
1150+
10341151
GridStack.prototype.setAnimation = function(enable) {
10351152
if (enable) {
10361153
this.container.addClass('grid-stack-animate');
@@ -1417,10 +1534,13 @@
14171534
this.grid.commit();
14181535
};
14191536

1420-
GridStack.prototype.setGridWidth = function(gridWidth) {
1537+
GridStack.prototype.setGridWidth = function(gridWidth,doNotPropagate) {
14211538
this.container.removeClass('grid-stack-' + this.opts.width);
1422-
this._updateNodeWidths(this.opts.width, gridWidth);
1539+
if (doNotPropagate !== true) {
1540+
this._updateNodeWidths(this.opts.width, gridWidth);
1541+
}
14231542
this.opts.width = gridWidth;
1543+
this.grid.width = gridWidth;
14241544
this.container.addClass('grid-stack-' + gridWidth);
14251545
};
14261546

0 commit comments

Comments
 (0)