* Fix condition that would rarely cause dialogs to not open properly (dialog wasn't getting destroyed before being replaced)

This commit is contained in:
Morgan Jones 2013-05-09 01:39:19 -06:00
parent 4b39567e29
commit 20ef7acda5

View File

@ -74,7 +74,9 @@ window.dialog = function(options) {
// Close out existing dialogs.
if(window.DIALOGS[id]) {
try {
$(window.DIALOGS[id]).dialog('close');
var selector = $(window.DIALOGS[id]);
selector.dialog('close');
selector.remove();
} catch(err) {
console.log('window.dialog: Tried to close nonexistent dialog ' + id);
}