Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new resize & drag events #459

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,78 @@ scope.$on('gridster-resized', function(sizes, gridster) {

## Gridster Item Events

#### gridster-item-resize-start
Once a user begins to resize an item Gridster broadcasts the event 'gridster-item-resize-start'. You can listen for it like this from within the gridster-item directive:

```js
scope.$on('gridster-item-resize-start', function(item) {
// item.$element
// item.gridster
// item.row
// item.col
// item.sizeX
// item.sizeY
// item.minSizeX
// item.minSizeY
// item.maxSizeX
// item.maxSizeY
})
```

#### gridster-item-resize-end
Once a user stops resizing an item Gridster broadcasts the event 'gridster-item-resize-end'. This is broadcasted before any transitions have completed. You can listen for it like this from within the gridster-item directive:

```js
scope.$on('gridster-item-resize-end', function(item) {
// item.$element
// item.gridster
// item.row
// item.col
// item.sizeX
// item.sizeY
// item.minSizeX
// item.minSizeY
// item.maxSizeX
// item.maxSizeY
})
```

#### gridster-item-drag-start
Once a user begins to drag an item Gridster broadcasts the event 'gridster-item-drag-start'. You can listen for it like this from within the gridster-item directive:

```js
scope.$on('gridster-item-drag-start', function(item) {
// item.$element
// item.gridster
// item.row
// item.col
// item.sizeX
// item.sizeY
// item.minSizeX
// item.minSizeY
// item.maxSizeX
// item.maxSizeY
})
```

#### gridster-item-drag-end
Once a user stops dragging an item Gridster broadcasts the event 'gridster-item-drag-end'. This is broadcasted before any transitions have completed. You can listen for it like this from within the gridster-item directive:

```js
scope.$on('gridster-item-drag-end', function(item) {
// item.$element
// item.gridster
// item.row
// item.col
// item.sizeX
// item.sizeY
// item.minSizeX
// item.minSizeY
// item.maxSizeX
// item.maxSizeY
})
```

#### gridster-item-transition-end
Gridster items have CSS transitions by default. Gridster items listen for css transition-end across different browsers and broadcast the event 'gridster-item-transition-end'. You can listen for it like this from within the gridster-item directive:

Expand Down
Loading