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

Add option to leave DOM in place when destroy() is called, add proper cleanup of generated_stylesheets. #296

Open
wants to merge 170 commits into
base: master
Choose a base branch
from

Conversation

billschaller
Copy link

Add the option suggested in #218 to allow clean destroy by running destroy(false). This allows you to use gridster on an element, and then destroy gridster without destroying the original DOM elements. This is what I'm using to cleanly implement window resizing at the moment.

Add some code to properly strip out generated style tags when destroying the gridster instance. It also removes the entries in the Gridster.generated_stylesheets static var. This should allow multiple gridster instances to play more nicely on the same page. This should take care of #284, #227, and is a more complete solution than #287.

dustmoo and others added 30 commits November 20, 2012 10:07
In initial options you can disble draggin by adding disable_drag: true on options list at initialising gridster
Added disabled dragging init feature gridster.js - Thank you sbehrends
…M in place

Added a new parameter 'removeDOM' to the destroy method - when false,
destroy leaves the DOM in place, but just removes all the gridster
business from it and removes classes and stylesheets it added.

Closes #218
Donald Adams and others added 30 commits April 14, 2015 12:33
If the element being dragged is inside a scrollable container, keeping the
mouse in one of the sides of the container will trigger scroll.
Original code will break if jquery noconflict is applied, where $ and jQuery produces jQuery instance of different versions.
Tests are build with mocha + chai, and you can run them from the command line with `grunt karma` or opening `test/index.html` in your browser.

This is a first approach, there are hundreds of tests more that should be added.
I’ve ported some tests on PRs but more needs to be done.
by default jQuery’s `hide` and `show` methods are used. You could also
use fadeIn/fadeOut or write your own kind of jQuery plugin like
`$.fn.showInAFancyWay` and use `showInAFancyWay` as the value in the
show_method config option.

If you want to keep the previos behaviour, you need to set
`hide_method` option to `’fadeOut’`

Breaking Changes

`remove_widget` and `remove_all_widgets` methods not return a promise
instead of the gridster instance
for consistency with the `remove_widget`
…when removing a widget, or when destroying the gridster instance.
Before this change, if you called destroy without `remove` set to true,
coords instances was leaking jQuery data objects.

Also nullified the gridmap, and faux_grid arrays.
fix(gridster): responsive width now resizes based off wrapper not window
typo on "the" in "inactivity over the last year"
…h has padding. It now limits the width of the widget to the containing element (also helps with scrollbars)
- delay moving components until drag is complete
- allow exact position of grid components (do not move up)
Conflicts:
	src/jquery.gridster.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.