You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+95-19Lines changed: 95 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,11 +4,11 @@ angular-gridster
4
4
5
5
An implementation of gridster-like widgets for Angular JS. This is not a wrapper on the original gridster jQuery plugin (http://gridster.net/). It is instead completely rewritten as Angular directives. Rewriting allowed for some additional features and better use of Angular data binding. Even more importantly, the original plugin had unpredictable behavior and crashed when wrapped with an Angular directive in my initial tests.
6
6
7
-
##Demo
7
+
##Demo
8
8
9
9
See <ahref="https://rawgit.com/ManifestWebDesign/angular-gridster/master/index.html">Live Demo</a>
10
10
11
-
##Usage
11
+
##Usage
12
12
13
13
Here is an example of the default usage:
14
14
```HTML
@@ -154,24 +154,100 @@ You can also override the default configuration site wide by modifying the ```gr
154
154
}]);
155
155
```
156
156
157
-
##Watching gridster element size changes
157
+
##Gridster Events
158
158
159
-
When the window or gridster element are resized, all the gridster item elements are resized accordingly and this event is broadcast:
159
+
#### gridster-mobile-changed
160
+
When the gridster goes in or out of mobile mode, a 'gridster-mobile-changed' event is broadcast on rootScope:
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:
After a gridster item's controller has finished with setup, it broadcasts an event 'gridster-item-initialized' on its own scope. You can listen for it like this from within the gridster-item directive:
After a gridster item's size changes (rows or columns), it broadcasts an event 'gridster-item-resized' on its own scope. You can listen for it like this from within the gridster-item directive:
The third argument, true, is to make the watch based on the value of the object, rather than just matching the reference to the object.
204
280
205
281
206
-
##Note
282
+
##Note
207
283
This directive/plugin does not generate style tags, like the jQuery plugin. It also uses standard camelCase for variables and object properties, while the original plugin used lower\_case\_with_underscores. These options have not and may never be implemented:
208
284
209
285
* widget_class - not necessary since directives already whatever classes and attributes you want to add
@@ -227,7 +303,7 @@ This directive/plugin does not generate style tags, like the jQuery plugin. It
227
303
* collision.on_overlap
228
304
* collision.on\_overlap\_stop
229
305
230
-
##Installation
306
+
##Installation
231
307
232
308
```bash
233
309
bower install angular-gridster
@@ -242,18 +318,18 @@ Then, import the following in your HTML alongside `jQuery` and `angular`:
242
318
243
319
`jquery.resize` is a jQuery plugin needed to check for changes in the gridster size.
244
320
245
-
##Contributing
321
+
##Contributing
246
322
247
-
####Install project dependencies
323
+
####Install project dependencies
248
324
```bash
249
325
npm install
250
326
bower install
251
327
```
252
328
253
-
####Style Guide
329
+
####Style Guide
254
330
Please respect the formatting specified in .editorconfig
0 commit comments