From 51547c33161b28dfa46ff0c160fada646737bdf1 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Tue, 10 Sep 2013 00:21:42 +0200 Subject: Fix setting ocdialog options after initialization. --- core/js/jquery.ocdialog.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'core') diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js index bafbd0e0e9f..ee492d15f58 100644 --- a/core/js/jquery.ocdialog.js +++ b/core/js/jquery.ocdialog.js @@ -83,20 +83,22 @@ var self = this; switch(key) { case 'title': - var $title = $('

' + this.options.title - + '

'); //
'); if(this.$title) { - this.$title.replaceWith($title); + this.$title.text(value); } else { + var $title = $('

' + + value + + '

'); this.$title = $title.prependTo(this.$dialog); } this._setSizes(); break; case 'buttons': - var $buttonrow = $('
'); + console.log('buttons', value); if(this.$buttonrow) { - this.$buttonrow.replaceWith($buttonrow); + this.$buttonrow.empty(); } else { + var $buttonrow = $('
'); this.$buttonrow = $buttonrow.appendTo(this.$dialog); } $.each(value, function(idx, val) { @@ -124,6 +126,8 @@ $closeButton.on('click', function() { self.close(); }); + } else { + this.$dialog.find('.oc-dialog-close').remove(); } break; case 'width': -- cgit v1.2.3 From fdfdd2e4e78ca025290b9525288c7546f62653f0 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Tue, 10 Sep 2013 00:25:07 +0200 Subject: Remove console logging --- core/js/jquery.ocdialog.js | 1 - 1 file changed, 1 deletion(-) (limited to 'core') diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js index ee492d15f58..fb161440ebb 100644 --- a/core/js/jquery.ocdialog.js +++ b/core/js/jquery.ocdialog.js @@ -94,7 +94,6 @@ this._setSizes(); break; case 'buttons': - console.log('buttons', value); if(this.$buttonrow) { this.$buttonrow.empty(); } else { -- cgit v1.2.3 From 7a2b23a0363032e5bcbc38546ab62aca122635bb Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Wed, 11 Sep 2013 17:13:39 +0200 Subject: Fix double destroy on escape. --- core/js/jquery.ocdialog.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js index fb161440ebb..f1836fd4727 100644 --- a/core/js/jquery.ocdialog.js +++ b/core/js/jquery.ocdialog.js @@ -39,7 +39,8 @@ return; } // Escape - if(event.keyCode === 27 && self.options.closeOnEscape) { + if(event.keyCode === 27 && event.type === 'keydown' && self.options.closeOnEscape) { + event.stopImmediatePropagation(); self.close(); return false; } -- cgit v1.2.3