417 Commits

Author SHA1 Message Date
6ebd10139f updated dist 2012-10-07 21:12:38 +02:00
42ce094e1c updated grunt config to generate gridster+extras distribution 2012-10-07 21:12:38 +02:00
cd5c936939 gridster extra methods
Some new methods we need at Ducksboard to implement TV mode.

Two new distributions of Gridster are generated with grunt:
    - jquery.gridster.with-extras.js
    - jquery.gridster.with-extras.min.js
2012-10-07 21:12:38 +02:00
7dbbc105c1 add_faux_cell: create parent array if doesn't exists 2012-10-07 21:12:38 +02:00
82b8778762 if not passed, use default namespace for generating stylessheets 2012-10-07 21:12:38 +02:00
7fc97d0f79 Allow to extend gridster out of the scope 2012-10-07 21:12:38 +02:00
0b1c9899d0 some code style corrections/improvements 2012-10-07 21:12:38 +02:00
c4fee63b96 ability to specify a max row as limit in can_move_to method 2012-10-03 15:40:16 +02:00
3d5077dd7b add_faux_cols method 2012-10-03 15:33:46 +02:00
c6bd80be8e Fixed disable method, it didn't work well for multiple instances.
Previously, disabling gridster caused all the instances of Gridster running on the pages was disabled. Because Draggable class uses event delegation from the body to manage drag events.
2012-10-03 13:48:55 +02:00
c503a4f99e updated dist 2012-09-12 17:51:44 +02:00
3bc9ea3527 Possibility to namespace first-time styles generated by gridster.
Useful if you have multiple grid instances in the same document.
2012-09-12 17:50:48 +02:00
104ee3220d updated dist 2012-09-09 14:32:49 +02:00
b71b8727df gridster: moving down widgets under placeholder. Related to #4.
This solves the overlapping-blocks seen in the screencast provided by @daniel-nelson. I've captured another one trying to reproduce the same movements with this commit applied: http://www.screenr.com/g7J8
2012-09-09 14:21:31 +02:00
dc61567454 collision: ignore min_area in collision sorting
This doesn't work with grids with small values in widget_base_dimensions and widget_margins options.
2012-09-08 13:58:47 +02:00
60fbb1cbf2 updated dist 2012-08-20 21:06:38 +02:00
9402f202b8 update coords for the new widget size.
Reported by @bmla in https://github.com/ducksboard/gridster.js/commit/dbf98cc9bdc#commitcomment-1735360
2012-08-20 21:06:21 +02:00
1086fe5b77 updated dist 2012-08-20 01:46:52 +02:00
dbf98cc9bd Resize widgets feature. Closes #15.
By popular demand, now gridster allows to change the size of widgets dynamically.

Usage.
- gridster_api.resize_wiget($widget, [size_x], [size_y]);

E.g. (try in gridster.net):
    - gridster.resize_widget($('.gs_w:eq(3)'), 6);
    - gridster.resize_widget($('.gs_w:eq(3)'), 1, 4);

To do this, two new methods were added to gridster:

    - empty_cells(col, row, size_x, size_y, $exclude)
      Move down widgets in cells represented by the arguments col, row, size_x,
      size_y.

    - remove_empty_cells(col, row, size_x, size_y, $exclude)
      Move up widgets below cells represented by the arguments col, row, size_x,
      size_y.

Also, add_widget method supports specifying a row and column. This was easy
through empty_cells method. Related to #24. Thanks to @parkerd for the help!

The code should be improved and make it more reusable when the feature of
"move widgets dynamically" is added (related to #20).
2012-08-20 01:31:34 +02:00
010444f57c Allow widgets to start in a specific col+row on the grid 2012-08-18 22:10:12 +02:00
32ea0da04b wip: resize widget feature 2012-08-18 22:10:12 +02:00
04301f48c9 updated dist 2012-08-18 19:47:26 +02:00
1d65da9260 Improving the way that rows are calculated. Related to #30.
Until now, the number of rows for the faux grid (this.cols) was calculated taking the highest
value among min_rows option, the highest widget, and the number of rows
that fits on the wrapper height (based on widget_base_dimensions, widget_margins
and extra_rows options).

In addition to this, styles for data-row attributes ara generated based on
this.cols (above) plus a constant value of 10. This was done to reduce
the number of cells by which iterate when dragging, but it's not very logical...

So, now the number of rows is calculated by adding the height of all widgets.
In this way we ensure that there is always available cells in the grid.
Also the same number of rows are generated for both the faux grid and
the DOM grid (css styles).
2012-08-18 19:34:47 +02:00
3ba70b7453 updated dist 2012-08-14 00:11:01 +02:00
573ed66922 fixes in drag/stop callbacks. Related to #23.
- break ondrag callback execution if stop event already was fired.
- unset this.$player after the execution of draggable.stop callback.
2012-08-14 00:06:03 +02:00
81c96b92d5 fixed: drag api access from gridster and draggable.disable method.
Fixes #25. I broke this in the issue #17 and commit 8e7a5c.
2012-08-13 22:32:35 +02:00
0fadccaa2f updated dist 2012-08-13 01:18:12 +02:00
8e7a5cec53 prevent selection when dragging 2012-08-13 00:35:28 +02:00
6c9eaf067d Fixes related to overlapping problems. Solve part of #4.
Some fixes are about errors (seen in the link provided by @floflow in #16)
produced by drag large blocks.
2012-08-12 18:47:02 +02:00
c047153f05 updated dist 2012-08-08 23:36:59 +02:00
d78bd254bd renamed jQuery adapter for Draggable class to $.fn.drag. Fixes #17.
Prevents name collisions with jQuery UI draggable module.
2012-08-08 23:33:31 +02:00
2c16638905 updated dist 2012-08-08 20:39:08 +02:00
5f4e6ded39 fixed index error in for loop. Fixes #16. 2012-08-08 20:37:02 +02:00
568f7210ea updated dist 2012-08-08 01:23:33 +02:00
148963d12f added max_size_x and max_size_y as configurable options. Fixes #16.
The maximum number of columns/rows that a widget can span
was hardcoded to 6. Maybe it makes sense for dashboards but
not for other uses of gridster.
2012-08-08 01:21:30 +02:00
151b3bffa6 updated dist 2012-08-07 01:01:00 +02:00
7dbf396e9c grunt: modified watch command config 2012-08-07 01:00:49 +02:00
dc0a548bd4 stupid typos 2012-08-07 00:59:58 +02:00
ca7577950e don't start drag if <button> is clicked 2012-08-07 00:59:00 +02:00
ded20e32f1 updated dist 2012-08-06 23:55:48 +02:00
f359a7eb76 fixed typo in docs 2012-08-06 23:55:30 +02:00
6e8de6d9ab updated dist 2012-08-05 12:40:27 +02:00
1316a37e60 added touch support. Closes #12, closes #9 2012-08-05 12:39:51 +02:00
0e942677ec increased scroll area size and scroll speed 2012-08-05 11:00:08 +02:00
9bf0283a1f updated dist 2012-08-03 23:51:55 +02:00
39a473cedf Doing form elements inside widgets clickable. Fixes #7. 2012-08-03 23:49:46 +02:00
9987989c8c Caching $(document.body) once document is ready. Fixes #10. 2012-08-03 16:45:49 +02:00
c03a11eed8 updated dist 2012-07-30 21:20:44 +02:00
4048784eaf Forcing conversion to arrays before calling Math.max 2012-07-30 21:17:03 +02:00
d6d3c67ea4 updated dist 2012-07-30 12:49:42 +02:00