Skip to content

Commit

Permalink
Merge pull request gridstack#665 from radiolips/feature/494
Browse files Browse the repository at this point in the history
Add `data-gs-resize-handles` option to allow for widgets to have thei…
  • Loading branch information
radiolips committed May 15, 2017
2 parents 1fbf9af + b5468d0 commit 7e054a3
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 8 deletions.
6 changes: 3 additions & 3 deletions dist/gridstack.all.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/gridstack.jQueryUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@
var value = arguments[3];
el.resizable(opts, key, value);
} else {
var handles = el.data('gs-resize-handles') ? el.data('gs-resize-handles') :
this.grid.opts.resizable.handles;
el.resizable(_.extend({}, this.grid.opts.resizable, {
handles: handles
}, {
start: opts.start || function() {},
stop: opts.stop || function() {},
resize: opts.resize || function() {}
Expand Down
2 changes: 1 addition & 1 deletion dist/gridstack.jQueryUI.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/gridstack.js
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,7 @@
noResize: Utils.toBool(el.attr('data-gs-no-resize')),
noMove: Utils.toBool(el.attr('data-gs-no-move')),
locked: Utils.toBool(el.attr('data-gs-locked')),
resizeHandles: el.attr('data-gs-resize-handles'),
el: el,
id: el.attr('data-gs-id'),
_grid: self
Expand Down
4 changes: 2 additions & 2 deletions dist/gridstack.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/gridstack.min.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion doc/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ Change log

## v1.0.0 (development)

- 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).
- 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)).
- 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)).

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

Expand Down
1 change: 1 addition & 0 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ gridstack.js API
- `data-gs-locked` - the widget will be locked. It means another widget wouldn't be able to move it during dragging or resizing.
The widget can still be dragged or resized. You need to add `data-gs-no-resize` and `data-gs-no-move` attributes
to completely lock the widget.
- `data-gs-resize-handles` - sets resize handles for a specific widget.

## Events

Expand Down
4 changes: 4 additions & 0 deletions src/gridstack.jQueryUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@
var value = arguments[3];
el.resizable(opts, key, value);
} else {
var handles = el.data('gs-resize-handles') ? el.data('gs-resize-handles') :
this.grid.opts.resizable.handles;
el.resizable(_.extend({}, this.grid.opts.resizable, {
handles: handles
}, {
start: opts.start || function() {},
stop: opts.stop || function() {},
resize: opts.resize || function() {}
Expand Down
1 change: 1 addition & 0 deletions src/gridstack.js
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,7 @@
noResize: Utils.toBool(el.attr('data-gs-no-resize')),
noMove: Utils.toBool(el.attr('data-gs-no-move')),
locked: Utils.toBool(el.attr('data-gs-locked')),
resizeHandles: el.attr('data-gs-resize-handles'),
el: el,
id: el.attr('data-gs-id'),
_grid: self
Expand Down

0 comments on commit 7e054a3

Please sign in to comment.