Fix remove after modal hide

modal hide is asynchronous and so removing the element before it has finished
to hide with fade, bootstrap will leave the backdrop.
This commit is contained in:
Cédric Krier committed 2015-03-24 21:13:50 +01:00
1 parent 5eb1fad2fe
commit 1b4a8928f0
4 files changed
+29 -8

No files matched your search

+4 -1
View File
@@ -2171,7 +2171,10 @@
return prm;
},
close: function(dialog) {
dialog.modal('hide').remove();
dialog.on('hidden.bs.modal', function(event) {
jQuery(this).remove();
});
dialog.modal('hide');
this.running = false;
}
});
+4 -1
View File
@@ -3486,7 +3486,10 @@
var record = this.record();
var close = function() {
file_dialog.modal('hide').remove();
file_dialog.on('hidden.bs.modal', function(event) {
jQuery(this).remove();
});
file_dialog.modal('hide');
};
var save_file = function() {
+17 -5
View File
@@ -204,6 +204,9 @@
this.el.modal('show');
this.screen.display();
}.bind(this));
this.el.on('hidden.bs.modal', function(event) {
jQuery(this).remove();
});
},
add: function() {
@@ -316,7 +319,7 @@
// Empty when opening from Many2One
this.screen.switch_view(this.prev_view.view_type);
}
this.el.modal('hide').remove();
this.el.modal('hide');
}
});
@@ -425,6 +428,9 @@
}
}.bind(this));
}.bind(this));
this.el.on('hidden.bs.modal', function(event) {
jQuery(this).remove();
});
},
response: function(response_id) {
var records;
@@ -454,7 +460,7 @@
this.callback(null);
}
};
this.el.modal('hide').remove();
this.el.modal('hide');
new Sao.Window.Form(screen, callback.bind(this), {
new_: true
});
@@ -468,7 +474,7 @@
}
}
this.callback(value);
this.el.modal('hide').remove();
this.el.modal('hide');
}
});
@@ -536,6 +542,9 @@
body.append(this.screen.screen_container.el);
this.el.modal('show');
};
this.el.on('hidden.bs.modal', function(event) {
jQuery(this).remove();
});
this.screen.model.execute('get_preferences_fields_view', [], {})
.then(set_view.bind(this), this.destroy);
@@ -570,7 +579,7 @@
prm.done(end);
},
destroy: function() {
this.el.modal('hide').remove();
this.el.modal('hide');
}
});
@@ -641,6 +650,9 @@
}));
}.bind(this));
this.el.modal('show');
this.el.on('hidden.bs.modal', function(event) {
jQuery(this).remove();
});
},
response: function(response_id) {
var revision = null;
@@ -650,7 +662,7 @@
revision = Sao.DateTime(parseInt(revision, 10));
}
}
this.el.modal('hide').remove();
this.el.modal('hide');
this.callback(revision);
}
});
+4 -1
View File
@@ -255,7 +255,10 @@
},
destroy: function(action) {
Sao.Wizard.Dialog._super.destroy.call(this);
this.dialog.modal('hide').remove();
this.dialog.on('hidden.bsd.modal', function(event) {
jQuery(this).remove();
});
this.dialog.modal('hide');
var dialog = jQuery('.wizard-dialog').filter(':visible')[0];
var is_menu = false;
var screen;