Commit 144e6b63 authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic Committed by Robert Lyon
Browse files

Bug 1741987: Update jquery - tinymce/imagebrowser

behatnotneeded

Change-Id: I0ac194b7d87298f49a0e0b2f926e7312febf17a3
parent 841c042b
...@@ -137,7 +137,7 @@ tinymce.PluginManager.add('imagebrowser', function(editor) { ...@@ -137,7 +137,7 @@ tinymce.PluginManager.add('imagebrowser', function(editor) {
jQuery('body').append(browser); jQuery('body').append(browser);
win = jQuery('#imagebrowser'); win = jQuery('#imagebrowser');
jQuery(formname).submit(function( event ) { jQuery(formname).on('submit', function( event ) {
event.preventDefault(); event.preventDefault();
onSubmitForm(); onSubmitForm();
}); });
...@@ -148,12 +148,12 @@ tinymce.PluginManager.add('imagebrowser', function(editor) { ...@@ -148,12 +148,12 @@ tinymce.PluginManager.add('imagebrowser', function(editor) {
}); });
// Formatting options toggle // Formatting options toggle
jQuery('#imgbrowserconf_toggleformatting_container').click(function(event) { jQuery('#imgbrowserconf_toggleformatting_container').on('click', function(event) {
jQuery('#imgbrowserconf_formattingoptions_container').toggleClass('js-hidden'); jQuery('#imgbrowserconf_formattingoptions_container').toggleClass('js-hidden');
jQuery('#formattingoptionstoggle').toggleClass('retracted'); jQuery('#formattingoptionstoggle').toggleClass('retracted');
}); });
jQuery(formname + '_align, ' + formname + '_hspace, ' + formname + '_vspace, ' + formname + '_border').change(function() { jQuery(formname + '_align, ' + formname + '_hspace, ' + formname + '_vspace, ' + formname + '_border').on('change', function() {
updateStyle(); updateStyle();
}); });
...@@ -185,24 +185,24 @@ tinymce.PluginManager.add('imagebrowser', function(editor) { ...@@ -185,24 +185,24 @@ tinymce.PluginManager.add('imagebrowser', function(editor) {
eval(configblock.data.javascript); eval(configblock.data.javascript);
if (deletebutton.length) { if (deletebutton.length) {
deletebutton.focus(); deletebutton.trigger('focus');
} }
// As we have several submit buttons in the form // As we have several submit buttons in the form
// Add the attribute clicked=true to the clicked button // Add the attribute clicked=true to the clicked button
// This will help identify which submit button was clicked // This will help identify which submit button was clicked
jQuery('form' + formname + ' input[type=submit], button[type=submit]').click(function() { jQuery('form' + formname + ' input[type=submit], button[type=submit]').on('click', function() {
jQuery("input[type=submit], button[type=submit]", jQuery(this).parents('form' + formname)).removeAttr("clicked"); jQuery("input[type=submit], button[type=submit]", jQuery(this).parents('form' + formname)).removeAttr("clicked");
// Add the submit button name/value as a hidden field to get this to work in FF // Add the submit button name/value as a hidden field to get this to work in FF
if (jQuery('#edit_file').length) { if (jQuery('#edit_file').length) {
jQuery('#edit_file').prop('name', jQuery(this).context.name).prop('value', jQuery(this).context.value); jQuery('#edit_file').prop('name', jQuery(this)[0].name).prop('value', jQuery(this)[0].value);
} }
else { else {
jQuery('<input>').attr({ jQuery('<input>').attr({
type: 'hidden', type: 'hidden',
id: 'edit_file', id: 'edit_file',
name: jQuery(this).context.name, name: jQuery(this)[0].name,
value: jQuery(this).context.value value: jQuery(this)[0].value
}).appendTo(jQuery(this).parents('form' + formname)); }).appendTo(jQuery(this).parents('form' + formname));
} }
jQuery(this).attr("clicked", "true"); jQuery(this).attr("clicked", "true");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment