Skip to content

Commit f8bc8e4

Browse files
author
Cody Rigney
authored
Merge pull request #1 from mrkmg/add-min-max-width-height
Add min max width height
2 parents d02e829 + 20268fb commit f8bc8e4

3 files changed

Lines changed: 19 additions & 3 deletions

File tree

dist/gridstack-angular.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,11 @@ app.directive('gridstackItem', ['$timeout', function($timeout) {
117117
gsItemY: '=',
118118
gsItemWidth: '=',
119119
gsItemHeight: '=',
120-
gsItemAutopos: '='
120+
gsItemAutopos: '=',
121+
gsItemMinHeight: '=?',
122+
gsItemMaxHeight: '=?',
123+
gsItemMinWidth: '=?',
124+
gsItemMaxWidth: '=?'
121125
},
122126
link: function(scope, element, attrs, controller) {
123127
if (scope.gsItemId) {
@@ -127,6 +131,10 @@ app.directive('gridstackItem', ['$timeout', function($timeout) {
127131
$(element).attr('data-gs-y', scope.gsItemY);
128132
$(element).attr('data-gs-width', scope.gsItemWidth);
129133
$(element).attr('data-gs-height', scope.gsItemHeight);
134+
$(element).attr('data-gs-min-width', scope.gsItemMinWidth);
135+
$(element).attr('data-gs-min-height', scope.gsItemMinHeight);
136+
$(element).attr('data-gs-max-width', scope.gsItemMaxWidth);
137+
$(element).attr('data-gs-max-height', scope.gsItemMaxHeight);
130138
$(element).attr('data-gs-auto-position', scope.gsItemAutopos);
131139
var widget = controller.addItem(element);
132140
var item = element.data('_gridstack_node');

dist/gridstack-angular.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/gridstackitem.directive.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ app.directive('gridstackItem', ['$timeout', function($timeout) {
1818
gsItemY: '=',
1919
gsItemWidth: '=',
2020
gsItemHeight: '=',
21-
gsItemAutopos: '='
21+
gsItemAutopos: '=',
22+
gsItemMinHeight: '=?',
23+
gsItemMaxHeight: '=?',
24+
gsItemMinWidth: '=?',
25+
gsItemMaxWidth: '=?'
2226
},
2327
link: function(scope, element, attrs, controller) {
2428
if (scope.gsItemId) {
@@ -28,6 +32,10 @@ app.directive('gridstackItem', ['$timeout', function($timeout) {
2832
$(element).attr('data-gs-y', scope.gsItemY);
2933
$(element).attr('data-gs-width', scope.gsItemWidth);
3034
$(element).attr('data-gs-height', scope.gsItemHeight);
35+
$(element).attr('data-gs-min-width', scope.gsItemMinWidth);
36+
$(element).attr('data-gs-min-height', scope.gsItemMinHeight);
37+
$(element).attr('data-gs-max-width', scope.gsItemMaxWidth);
38+
$(element).attr('data-gs-max-height', scope.gsItemMaxHeight);
3139
$(element).attr('data-gs-auto-position', scope.gsItemAutopos);
3240
var widget = controller.addItem(element);
3341
var item = element.data('_gridstack_node');

0 commit comments

Comments
 (0)