154 Commits

Author SHA1 Message Date
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
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
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
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
5f4e6ded39 fixed index error in for loop. Fixes #16. 2012-08-08 20:37:02 +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
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
f359a7eb76 fixed typo in docs 2012-08-06 23:55:30 +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
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
4048784eaf Forcing conversion to arrays before calling Math.max 2012-07-30 21:17:03 +02:00
6972f9fb33 recalculate grid height when a widget is removed 2012-07-27 17:55:04 +02:00
f4e425ced2 switch to using the MIT license exclusively 2012-07-27 13:29:07 +02:00
341e1bbd4c prevent cols/rows from being empty arrays (needed to pass phantom tests) 2012-07-26 09:58:39 +02:00
e4e06f4cde gridster: passing Math (not null) as first argument in Math.max.apply() 2012-07-25 17:58:18 +02:00
f12cebb33e increased the mouse area that triggers scroll 2012-07-24 17:05:07 +02:00
06b53fdc19 throttling to 60ms to prevent overlapping 2012-07-24 16:56:16 +02:00
0016c99a61 offsetX is not needed 2012-07-24 16:55:53 +02:00
3460a436b2 scroll logic based on mouse position, not in items position 2012-07-24 16:25:43 +02:00
3456aef408 trottling drag callback 2012-07-24 15:40:49 +02:00
b5a2a2c4cd scroll document when dragging up or down 2012-07-24 15:40:32 +02:00
443d0fbc29 jslinting 2012-07-24 10:34:12 +02:00
4eb679fb78 documentation fixes 2012-07-23 22:51:04 +02:00
33b8f206cf updated Gridster doc and code style corrections 2012-07-23 22:07:43 +02:00
7e8ce8dd0a Coords constructor documentation 2012-07-23 21:50:15 +02:00
7ae385ea05 some small documentation for draggable class 2012-07-23 21:49:53 +02:00
00e7c46b31 avoid calls to empty functions in defaults object 2012-07-23 21:48:25 +02:00
bf2ee67450 only start drag with right click 2012-07-23 21:46:27 +02:00
981895eab4 default value for css transitions is: "all 0s" not "none" 2012-07-23 21:44:51 +02:00
f650da8586 fixing tab spaces and some documentation 2012-07-23 21:44:03 +02:00
f0a50649d1 removing playing-revert class when gridster is disabled 2012-07-23 15:14:53 +02:00
d1b7009fc9 improved and more robust css 2012-07-23 11:04:33 +02:00
3e1d005585 don`t recalculate offset if it is passed to the update method 2012-07-23 11:03:06 +02:00
0446186c98 utils: throttle, debounce 2012-07-23 11:02:18 +02:00
288df54e86 basic jQuery draggable plugin 2012-07-23 11:01:48 +02:00
5edfe0a488 new methods, fixes and improvements:
- new disable, enable methods

- don't generate duplicated stylesheets for the same origin config

- new configuration option called avoid_overlapped_widgets. Avoid that widgets loaded from the DOM can be overlapped. It is helpful if the positions were bad stored in the database or if there was any conflict.

- Removed jquery ui dependencie.

- Fix to prevent widgets go out of the grid.

- New methods to get all widgets from a column or row.

- generate_stylesheets method now supports namespaces to generate multiple stylesheets based on a parent class.
2012-07-23 11:01:05 +02:00
1507974e07 collision: don't calculate player coords if we have it 2012-07-23 10:53:57 +02:00
18b620f6ce the remove_widget callback must be inside the fadeout callback 2012-07-20 15:47:39 +02:00
fbeb2ac05c fixed add_widget method 2012-07-20 14:03:24 +02:00
9dbad2b29e remove_widget accepts a callback as second argument 2012-07-20 14:03:03 +02:00
7624182bf4 updated docs and diet 2012-07-20 11:06:26 +02:00
0e03a05435 namespaced gridster events: dragstart, dragstop, drag 2012-07-20 11:04:54 +02:00
79bec6897f using next_positions inside add_widget method 2012-07-19 16:44:49 +02:00
97074001bb fixed a bug that caused next_positions method redefinition 2012-07-19 16:10:31 +02:00
2bcd943fff new method to get the next position of a new widget 2012-07-19 15:56:01 +02:00