Skip to content
Snippets Groups Projects
Commit 7a9293f7 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Fix update credentials when multiple OpenTools plugins are installed

parent ccfc32d1
No related branches found
No related tags found
No related merge requests found
......@@ -5,21 +5,27 @@ var showUpdateCredentialsRow = function (btn) {
var ajaxurl = jQuery(btn).data('ajaxurl');
var slug = jQuery(btn).data("slug");
var nonce = jQuery(btn).data("nonce");
var ajaxargs = {
type: "POST",
url: ajaxurl,
data: {
action: 'getUpdateCredentialsRow_'+slug,
slug: slug,
_ajax_nonce: nonce
},
success: function ( json ) {
jQuery(btn).closest('tr').after(json['row']);
},
error: function() { },
complete: function() { },
};
jQuery.ajax(ajaxargs);
var credentialRow = jQuery(btn).closest('table').find('tr#'+slug+'-credentials');
if (credentialRow.length > 0) {
jQuery(credentialRow).fadeOut(1000, function() { jQuery(this).remove(); });
} else {
var ajaxargs = {
type: "POST",
url: ajaxurl,
data: {
action: 'getUpdateCredentialsRow_'+slug,
slug: slug,
_ajax_nonce: nonce
},
success: function ( json ) {
jQuery(btn).closest('tr').after(json['row']);
},
error: function() { },
complete: function() { },
};
jQuery.ajax(ajaxargs);
}
return false;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment