Fixed a minor issue when trying to destroy a non existing drag_api

This commit is contained in:
Davide Callegari
2013-02-15 16:50:35 +01:00
parent 7217b040e6
commit 7f3f679cb6
5 changed files with 16 additions and 13 deletions

View File

@@ -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

File diff suppressed because one or more lines are too long

View File

@@ -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

File diff suppressed because one or more lines are too long

View File

@@ -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