|
1 | 1 | /**
|
2 |
| - * gridstack.js 0.2.5-dev |
| 2 | + * gridstack.js 0.2.5 |
3 | 3 | * http://troolee.github.io/gridstack.js/
|
4 | 4 | * (c) 2014-2016 Pavel Reznikov
|
5 | 5 | * gridstack.js may be freely distributed under the MIT license.
|
|
99 | 99 | var height = val;
|
100 | 100 | var heightUnit = 'px';
|
101 | 101 | 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)?$/); |
103 | 103 | if (!match) {
|
104 | 104 | throw new Error('Invalid height');
|
105 | 105 | }
|
|
367 | 367 | return $.extend({}, n);
|
368 | 368 | }));
|
369 | 369 |
|
| 370 | + if (typeof clonedNode === 'undefined') { |
| 371 | + return true; |
| 372 | + } |
| 373 | + |
370 | 374 | clone.moveNode(clonedNode, x, y, width, height);
|
371 | 375 |
|
372 | 376 | var res = true;
|
|
477 | 481 | opts.placeholderText = opts.placeholder_text;
|
478 | 482 | obsoleteOpts('placeholder_text', 'placeholderText');
|
479 | 483 | }
|
480 |
| - if (typeof opts.item_class !== 'undefined') { |
481 |
| - opts.itemClass = opts.item_class; |
482 |
| - obsoleteOpts('item_class', 'itemClass'); |
483 |
| - } |
484 | 484 | if (typeof opts.cell_height !== 'undefined') {
|
485 | 485 | opts.cellHeight = opts.cell_height;
|
486 | 486 | obsoleteOpts('cell_height', 'cellHeight');
|
|
541 | 541 | disableResize: opts.disableResize || false,
|
542 | 542 | rtl: 'auto',
|
543 | 543 | removable: false,
|
544 |
| - removeTimeout: 2000 |
| 544 | + removeTimeout: 2000, |
| 545 | + verticalMarginUnit: 'px', |
| 546 | + cellHeightUnit: 'px' |
545 | 547 | });
|
546 | 548 |
|
547 | 549 | if (this.opts.rtl === 'auto') {
|
|
1538 | 1540 | this.grid.commit();
|
1539 | 1541 | };
|
1540 | 1542 |
|
1541 |
| - GridStack.prototype.setGridWidth = function(gridWidth) { |
| 1543 | + GridStack.prototype.setGridWidth = function(gridWidth,doNotPropagate) { |
1542 | 1544 | this.container.removeClass('grid-stack-' + this.opts.width);
|
1543 |
| - this._updateNodeWidths(this.opts.width, gridWidth); |
| 1545 | + if (doNotPropagate !== true) { |
| 1546 | + this._updateNodeWidths(this.opts.width, gridWidth); |
| 1547 | + } |
1544 | 1548 | this.opts.width = gridWidth;
|
| 1549 | + this.grid.width = gridWidth; |
1545 | 1550 | this.container.addClass('grid-stack-' + gridWidth);
|
1546 | 1551 | };
|
1547 | 1552 |
|
|
0 commit comments