add maxWidth/maxHeight

This commit is contained in:
Pavel Reznikov 2016-02-17 19:03:21 -08:00
commit 02f0eba64d
5 changed files with 93 additions and 8 deletions

View file

@ -991,6 +991,23 @@
return this;
};
GridStack.prototype.maxHeight = function(el, val) {
el = $(el);
el.each(function(index, el) {
el = $(el);
var node = el.data('_gridstack_node');
if (typeof node == 'undefined' || node == null) {
return;
}
if (!isNaN(val)) {
node.maxHeight = (val || false);
el.attr('data-gs-max-height', val);
}
});
return this;
};
GridStack.prototype.minHeight = function(el, val) {
el = $(el);
el.each(function(index, el) {
@ -1008,6 +1025,23 @@
return this;
};
GridStack.prototype.maxWidth = function(el, val) {
el = $(el);
el.each(function(index, el) {
el = $(el);
var node = el.data('_gridstack_node');
if (typeof node == 'undefined' || node == null) {
return;
}
if (!isNaN(val)) {
node.maxWidth = (val || false);
el.attr('data-gs-max-width', val);
}
});
return this;
};
GridStack.prototype.minWidth = function(el, val) {
el = $(el);
el.each(function(index, el) {