ducksboard / gridster.js

gridster.js is a jQuery plugin that makes building intuitive draggable layouts from elements spanning multiple columns
http://gridster.net/
MIT License
6.03k stars 1.2k forks source link

removing element on remove_widget #537

Closed mauron85 closed 9 years ago

mauron85 commented 9 years ago

method fn.remove_widget is removing $el element causing layout manager remove methods to fail.

Layout managers like backbone.viewmaster or also plain backbone also have remove methods, for example to clean some jquery plugins. But they also operate on $el, which is effectively destroyed in fn.remove_widget method. So I get some weird errors that $el doesn not exists.

I suggest to not do $el removal in that method.

...
$el.fadeOut($.proxy(function () {
    $el.remove();
...
mauron85 commented 9 years ago

Closing. My issue can be solved, by removing backbone view first and only after that call remove_widget.