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

Skip to content

Commit 7e054a3

Browse files
authored
Merge pull request gridstack#665 from radiolips/feature/494
Add `data-gs-resize-handles` option to allow for widgets to have thei…
2 parents 1fbf9af + b5468d0 commit 7e054a3

10 files changed

+20
-8
lines changed

dist/gridstack.all.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/gridstack.jQueryUI.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@
4747
var value = arguments[3];
4848
el.resizable(opts, key, value);
4949
} else {
50+
var handles = el.data('gs-resize-handles') ? el.data('gs-resize-handles') :
51+
this.grid.opts.resizable.handles;
5052
el.resizable(_.extend({}, this.grid.opts.resizable, {
53+
handles: handles
54+
}, {
5155
start: opts.start || function() {},
5256
stop: opts.stop || function() {},
5357
resize: opts.resize || function() {}

dist/gridstack.jQueryUI.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.

dist/gridstack.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,7 @@
12481248
noResize: Utils.toBool(el.attr('data-gs-no-resize')),
12491249
noMove: Utils.toBool(el.attr('data-gs-no-move')),
12501250
locked: Utils.toBool(el.attr('data-gs-locked')),
1251+
resizeHandles: el.attr('data-gs-resize-handles'),
12511252
el: el,
12521253
id: el.attr('data-gs-id'),
12531254
_grid: self

dist/gridstack.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/gridstack.min.map

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

doc/CHANGES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ Change log
2020

2121
## v1.0.0 (development)
2222

23-
- enable sidebar items to be duplicated properly. Pass `helper: 'clone'` in `draggable` options. ([#661](https://github.com/troolee/gridstack.js/issues/661), ([#396](https://github.com/troolee/gridstack.js/issues/396), ([#499](https://github.com/troolee/gridstack.js/issues/499).
23+
- widgets can have their own resize handles. Use `data-gs-resize-handles` element attribute to use. For example, `data-gs-resize-handles="e,w"` will make the particular widget only resize west and east. ([#494](https://github.com/troolee/gridstack.js/issues/494)).
24+
- enable sidebar items to be duplicated properly. Pass `helper: 'clone'` in `draggable` options. ([#661](https://github.com/troolee/gridstack.js/issues/661), ([#396](https://github.com/troolee/gridstack.js/issues/396), ([#499](https://github.com/troolee/gridstack.js/issues/499)).
2425

2526
## v0.3.0 (2017-04-21)
2627

doc/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ gridstack.js API
111111
- `data-gs-locked` - the widget will be locked. It means another widget wouldn't be able to move it during dragging or resizing.
112112
The widget can still be dragged or resized. You need to add `data-gs-no-resize` and `data-gs-no-move` attributes
113113
to completely lock the widget.
114+
- `data-gs-resize-handles` - sets resize handles for a specific widget.
114115

115116
## Events
116117

src/gridstack.jQueryUI.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@
4747
var value = arguments[3];
4848
el.resizable(opts, key, value);
4949
} else {
50+
var handles = el.data('gs-resize-handles') ? el.data('gs-resize-handles') :
51+
this.grid.opts.resizable.handles;
5052
el.resizable(_.extend({}, this.grid.opts.resizable, {
53+
handles: handles
54+
}, {
5155
start: opts.start || function() {},
5256
stop: opts.stop || function() {},
5357
resize: opts.resize || function() {}

src/gridstack.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,7 @@
12481248
noResize: Utils.toBool(el.attr('data-gs-no-resize')),
12491249
noMove: Utils.toBool(el.attr('data-gs-no-move')),
12501250
locked: Utils.toBool(el.attr('data-gs-locked')),
1251+
resizeHandles: el.attr('data-gs-resize-handles'),
12511252
el: el,
12521253
id: el.attr('data-gs-id'),
12531254
_grid: self

0 commit comments

Comments
 (0)