Commit 7a9293f7 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer

Fix update credentials when multiple OpenTools plugins are installed

parent ccfc32d1
......@@ -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;
};
......
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