Skip to content

Commit

Permalink
Remove html code when we close dialog either with cancel button or x …
Browse files Browse the repository at this point in the history
…icon at the top of dialog. Closes refinery#860.
  • Loading branch information
ugisozols committed Aug 11, 2011
1 parent a5f70fc commit 63b24ee
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -1781,10 +1781,16 @@ WYMeditor.INIT_DIALOG = function(wym, selected, isIframe) {
// focus first textarea or input type text element
dialog.find('input[type=text], textarea').first().focus();

// init close_dialog when user clicks on cancel button
doc.find('body').addClass('wym_iframe_body').find('#cancel_button').add(dialog.find('.close_dialog')).click(function(e){
wym.close_dialog(e, true);
});

// init close_dialog when user clicks on small x icon at the top of dialog
$('.ui-dialog-titlebar .ui-dialog-titlebar-close').click(function(e){
wym.close_dialog(e, true);
});

//pre-init functions
if($.isFunction(wym._options.preInitDialog)) {
wym._options.preInitDialog(wym, window);
Expand Down

0 comments on commit 63b24ee

Please sign in to comment.