Skip to content

Commit 495918f

Browse files
committed
build dist
1 parent e09b0c9 commit 495918f

File tree

5 files changed

+41
-30
lines changed

5 files changed

+41
-30
lines changed

dist/gridstack.css

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
position: relative;
77
}
88

9+
.grid-stack.grid-stack-rtl {
10+
direction: ltr;
11+
}
12+
13+
.grid-stack.grid-stack-rtl > .grid-stack-item {
14+
direction: rtl;
15+
}
16+
917
.grid-stack .grid-stack-placeholder > .placeholder-content {
1018
border: 1px dashed lightgray;
1119
margin: 0;
@@ -358,13 +366,6 @@
358366
transition: left 0s, top 0s, height 0s, width 0s;
359367
}
360368

361-
/** Uncomment this to show bottom-left resize handle **/
362-
/*
363-
.grid-stack > .grid-stack-item > .ui-resizable-sw {
364-
display: inline-block;
365-
@include vendor(transform, rotate(180deg));
366-
}
367-
*/
368369
@media (max-width: 768px) {
369370
.grid-stack-item {
370371
position: relative !important;

dist/gridstack.js

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,20 @@
9898

9999
_isAddNodeIntercepted: function(n) {
100100
return Utils.isIntercepted({x: this.x, y: this.y, width: this.node.width, height: this.node.height}, n);
101+
},
102+
103+
parseHeight: function(val) {
104+
var height = val;
105+
var heightUnit = 'px';
106+
if (height && _.isString(height)) {
107+
var match = height.match(/^([0-9]*\.[0-9]+|[0-9]+)(px|em|rem|vh|vw)?$/);
108+
if (!match) {
109+
throw new Error('Invalid height');
110+
}
111+
heightUnit = match[2];
112+
height = parseFloat(match[1]);
113+
}
114+
return {height: height, unit: heightUnit};
101115
}
102116
};
103117

@@ -514,8 +528,18 @@
514528
appendTo: 'body'
515529
}),
516530
disableDrag: opts.disableDrag || false,
517-
disableResize: opts.disableResize || false
531+
disableResize: opts.disableResize || false,
532+
rtl: 'auto'
518533
});
534+
535+
if (this.opts.rtl === 'auto') {
536+
this.opts.rtl = this.container.css('direction') === 'rtl';
537+
}
538+
539+
if (this.opts.rtl) {
540+
this.container.addClass('grid-stack-rtl');
541+
}
542+
519543
this.opts.isNested = isNested;
520544

521545
this.cellHeight(this.opts.cellHeight, true);
@@ -1125,26 +1149,12 @@
11251149
});
11261150
};
11271151

1128-
function parseHeight(val) {
1129-
var height = val;
1130-
var heightUnit = 'px';
1131-
if (height && _.isString(height)) {
1132-
var match = height.match(/^([0-9]*\.[0-9]+|[0-9]+)(px|em|rem|vh|vw)?$/);
1133-
if (!match) {
1134-
throw new Error('Invalid height');
1135-
}
1136-
heightUnit = match[2];
1137-
height = parseFloat(match[1]);
1138-
}
1139-
return {height: height, unit: heightUnit};
1140-
}
1141-
11421152
GridStack.prototype.verticalMargin = function(val, noUpdate) {
11431153
if (typeof val == 'undefined') {
11441154
return this.opts.verticalMargin;
11451155
}
11461156

1147-
var heightData = parseHeight(val);
1157+
var heightData = Utils.parseHeight(val);
11481158

11491159
if (this.opts.verticalMarginUnit === heightData.unit && this.opts.height === heightData.height) {
11501160
return ;
@@ -1165,7 +1175,7 @@
11651175
var o = this.container.children('.' + this.opts.itemClass).first();
11661176
return Math.ceil(o.outerHeight() / o.attr('data-gs-height'));
11671177
}
1168-
var heightData = parseHeight(val);
1178+
var heightData = Utils.parseHeight(val);
11691179

11701180
if (this.opts.cellHeightUnit === heightData.heightUnit && this.opts.height === heightData.height) {
11711181
return ;

0 commit comments

Comments
 (0)