Skip to content

Commit

Permalink
Fixed a minor issue when trying to destroy a non existing drag_api
Browse files Browse the repository at this point in the history
  • Loading branch information
brokenseal committed Feb 15, 2013
1 parent 7217b04 commit 7f3f679
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
9 changes: 5 additions & 4 deletions dist/jquery.gridster.js
Original file line number Diff line number Diff line change
Expand Up @@ -3236,11 +3236,12 @@
*/
fn.destroy = function(){
// remove bound callback on window resize
$(window).unbind('resize', this.resize_callback);

// TODO: remove draggable bindings
this.drag_api.destroy();
$(window).unbind('resize', this.on_window_resize);

if(this.drag_api){
this.drag_api.destroy();
}

// lastly, remove gridster element
// this will additionally cause any data associated to this element to be removed, including this
// very gridster instance
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.gridster.min.js

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions dist/jquery.gridster.with-extras.js
Original file line number Diff line number Diff line change
Expand Up @@ -3236,11 +3236,12 @@
*/
fn.destroy = function(){
// remove bound callback on window resize
$(window).unbind('resize', this.resize_callback);

// TODO: remove draggable bindings
this.drag_api.destroy();
$(window).unbind('resize', this.on_window_resize);

if(this.drag_api){
this.drag_api.destroy();
}

// lastly, remove gridster element
// this will additionally cause any data associated to this element to be removed, including this
// very gridster instance
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.gridster.with-extras.min.js

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions src/jquery.gridster.js
Original file line number Diff line number Diff line change
Expand Up @@ -2531,9 +2531,10 @@
// remove bound callback on window resize
$(window).unbind('resize', this.on_window_resize);

// TODO: remove draggable bindings
this.drag_api.destroy();

if(this.drag_api){
this.drag_api.destroy();
}

// lastly, remove gridster element
// this will additionally cause any data associated to this element to be removed, including this
// very gridster instance
Expand Down

0 comments on commit 7f3f679

Please sign in to comment.