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) {
jQuery('body').append(browser);
win = jQuery('#imagebrowser');
jQuery(formname).submit(function( event ) {
jQuery(formname).on('submit', function( event ) {
event.preventDefault();
onSubmitForm();
});
......@@ -148,12 +148,12 @@ tinymce.PluginManager.add('imagebrowser', function(editor) {
});
// 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('#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();
});
......@@ -185,24 +185,24 @@ tinymce.PluginManager.add('imagebrowser', function(editor) {
eval(configblock.data.javascript);
if (deletebutton.length) {
deletebutton.focus();
deletebutton.trigger('focus');
}
// As we have several submit buttons in the form
// Add the attribute clicked=true to the clicked button
// 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");
// Add the submit button name/value as a hidden field to get this to work in FF
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 {
jQuery('<input>').attr({
type: 'hidden',
id: 'edit_file',
name: jQuery(this).context.name,
value: jQuery(this).context.value
name: jQuery(this)[0].name,
value: jQuery(this)[0].value
}).appendTo(jQuery(this).parents('form' + formname));
}
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