Commit Graph
143 Commits
Author SHA1 Message Date
vieron aef185c5da style: some formatting changes 2014-06-24 23:08:49 +02:00
vieron b2323910ba chore: move sorting methods in prototype to the constructor
Useful to use them when we there is no gridster instance, like sorting
a previously stored output from the serialize method.
2014-06-24 23:08:49 +02:00
vieron 021a6c23e8 fix(draggable): handle both touch and click events
Fixes #207, #236, #329, and #380
2014-06-16 18:45:50 +02:00
David Kwakandvieron 7d22e6c8b2 fix(gridster): fix add_widget to use correct size_y when adding rows 2014-06-16 17:03:00 +02:00
Hannes Rosenbauerandvieron bb7463a324 fix(draggable): replaced scrollX/Y with scrollLeft/Top
window.scrollX/Y is only available in Chrome, not in IE
2014-06-16 17:03:00 +02:00
Hannes Rosenbauerandvieron c726c4ad9c fix(draggable): fix offset during drag
when the scrollX/Y is changed during drag (e.g. by the mousewheel)
the offset wasn't correct
2014-06-16 17:03:00 +02:00
David Smallandvieron 93c46ff45e fix(gridster): Removing previously added style tags before adding new one.
Hopefully fixes #211 and #294.
2014-06-16 16:59:20 +02:00
Hannes Rosenbauerandvieron dd6c742008 fix(draggable): bind drag events to $document
$body won't receive mouseup if the cursor is outside the browser window, $document does
2014-06-16 16:59:07 +02:00
vieron 69fcfe4596 feat(draggable): allow ignore_dragging config option to be a function 2014-03-26 12:38:06 +01:00
vieron 03910df967 feat(draggable): option to not remove helper on drag stop 2014-03-13 00:11:29 +01:00
vieron dc09f191d8 feat(gridster): destroy element's data and optionally remove from DOM 2014-03-05 18:26:45 +01:00
vieron 04868a384d feat(draggable): keep container position prop if different than static 2014-03-05 17:47:39 +01:00
vieron 6f22217f05 feat(coords): allow both (left/x1) and (top/y1) attr keys 2014-03-05 17:36:11 +01:00
vieron fdeee4f636 feat(coords): add destroy method 2014-03-05 17:33:04 +01:00
vieron 720d487e39 feat(collision): overlapping region as a config option 2014-03-05 17:29:45 +01:00
ciaranjandvieron e21f63a05a fix(resize.stop): Call resize.stop at the latest possible moment
Previously the resize.stop callback was being called before the widget
had reached the end size that Gridster would make it (the widget grows
to match the placeholder size after releasing the drag)

This change pushes the resize.stop callback to the last possible moment
where the size of the widget the callback receives is more likely to be
correct.

Signed-off-by: ciaranj <[email protected]>

Conflicts:
	src/jquery.gridster.js
2014-02-14 13:09:03 +01:00
vieron 835c2df844 fix(autogrow): refining autogrow_cols behavior and grid width issues 2014-02-14 13:09:02 +01:00
vieron 7ca8deec85 feat(resize): add start/stop/resize event triggers 2014-02-13 11:26:56 +01:00
vieron f8b04f298e fix(generated-styles): cleaning cached serializations properly 2014-02-11 01:04:32 +01:00
vieron 4774597834 fix: recalculate grid width when adding widgets 2014-02-07 18:27:07 +01:00
vieron 5672edb05e fix: add resize.min_size option to default config object 2014-02-07 15:09:55 +01:00
Alex Colesandvieron 7ed79e5672 fix(gridster): leaking options with multiple Gridster instances
`defaults` was being overwritten.

See [jQuery documentation](http://api.jquery.com/jQuery.extend/):

> Keep in mind that the target object (first argument) will be modified, and will also be returned from $.extend().
2014-02-07 14:48:53 +01:00
Daniel Mattesandvieron 429c776aa9 feat(resize): add option to set min_size of a widget 2014-02-07 14:48:53 +01:00
Martin Woodwardandvieron 6f20723039 fix(licenses): add required copyright message for underscore
Add the copyright message for the code taken from underscore as required
by the MIT license.
2014-02-07 14:48:53 +01:00
Pedro Almeidaandvieron e9dc513457 fix(gridster): resize.axes default option only 'both'
If passing resize.axes option it will be
what is defined and not ['x','y','both'].
2014-02-07 14:48:53 +01:00
vieron b65a802964 feat(gridster): increase grid width when dragging or resizing 2014-02-07 14:48:52 +01:00
vieron 8fa3ad258f feat(draggable): method to set drag limits dynamically 2014-02-07 14:48:52 +01:00
vieron 3e426c9301 chore: rename calculate_positions to calculate_dimensions 2014-02-07 14:48:52 +01:00
vieron b0b4464a5c feat(draggable): support horizontal scrolling while dragging 2014-02-07 14:48:52 +01:00
vieron 381a881501 chore: use $ instead of jQuery inside gridster 2014-02-07 14:48:52 +01:00
activeworxandvieron d4ec7140f7 feat(resize): Add start/stop/resize callbacks 2013-10-28 23:52:17 +01:00
vieron e19240532d feat(gridster): drag-and-drop widget resizing 2013-10-26 19:52:10 +02:00
vieron 8e58cf8a44 style: some whitespaces, line-breaks... 2013-10-26 19:52:10 +02:00
vieron d0ca62826a chore(draggable): jQuery adapter returns Draggable instance
Draggable instance instead of a jQuery collection.
Why? Becomes a mess if Draggable is instantiated multiple times from
the same HTML element.

BREAKING CHANGES: If you was accessing to Draggable instances through
.data('drag') you should remove the `data` getter. Since now the instance
is returned directly.
2013-10-26 19:52:10 +02:00
vieron 4d9b2a84f1 feat(draggable): new config option to move or not the dragged element 2013-10-26 19:52:10 +02:00
vieron 0f95624925 feat(draggable): CSS selectors support in ignore_dragging config opt 2013-10-26 19:52:10 +02:00
vieron 055cc0e4f6 feat(draggable): pass previous position to the drag callback 2013-10-26 19:52:10 +02:00
vieron 91ca65721c feat(draggable): Don't start new drag if previous one hasn't stopped
Moving 4e6159fb by @atesgoral into draggable.js
2013-10-26 19:52:10 +02:00
vieron 4b1b2b7259 chore(draggable): add default helper config option for clarify 2013-10-26 19:49:31 +02:00
vieron c1668d9ab6 chore(css naming): gs_w to gs-w following CSS naming conventions
BREAKING CHANGE: If you are using `gs_w` classes somewhere, replace
them with `gs-w`
2013-10-26 19:49:31 +02:00
vieron 8dda2410f3 feat(draggable): pass useful data to all drag callbacks
start/stop/drag callbacks receive: element offset, cursor position,
and references to $player and $helper elements.
2013-10-26 19:49:31 +02:00
vieron faa6c5db00 feat(utils): add delay helper to utils 2013-10-26 19:49:31 +02:00
vieron 21fcad9a28 style(generated-css): add line breaks in css declarations 2013-10-26 19:49:31 +02:00
vieron ae02b32b92 fix: fixes and improvements in widget-resizing. Closes #32 2013-10-26 19:49:31 +02:00
Ates Goralandvieron 1ade74e239 fix(gridster): the preview holder should not always use li
Use the same element as the original widget for the preview holder.
Using a <li> can cause a list item bullet to be displayed when widgets
are not necessarily <li> elements.
2013-10-26 19:49:30 +02:00
bastianonmandvieron 31fd8d6ba8 fix(gridster): overlapping widget problem 2013-10-26 19:49:28 +02:00
Ates Goralandvieron 1b13617df2 fix(gridster): Orphan preview holder when dragging is interrupted
After beginning a drag, if the mouse button is released outside of the
screen, and if a subsequent drag operation is begun on another widget
(while the previous widget still follows the mouse around), Draggable
will trigger a new drag start event, causing Gridster to leave the
current widget + its preview holder aside and start dragging the new
widget. This will lead to an orphan preview holder to be left on the
screen.

A quick solution is to ignore drag start without receiving a drag stop.
2013-10-26 17:43:54 +02:00
Michal Stefanowandvieron 5bfbc5c0b5 fix(gridster): remove_widget Returns the instance of the Gridster Class
Following same pattern as remove_all_widgets --> remove_widget also
return *this* (as per inlined comment documentation)
2013-10-26 17:43:54 +02:00
vieron c0c12d0c38 gridster/fix: calculating container_width correctly
Thanks @badtant for the notice (https://github.com/ducksboard/gridster.js/commit/3d755fd793e7e74cbdc56d9a86143f4ebf779a98#commitcomment-3423763)
2013-06-14 12:03:06 +02:00
vieron f749c13e4a updated dist 2013-06-13 15:36:40 +02:00