From a0d96494ea8ff07a43a3c4091b086e31257d0403 Mon Sep 17 00:00:00 2001 From: j2blake Date: Fri, 9 Dec 2011 22:06:00 +0000 Subject: [PATCH] NIHVIVO-3468 When the click comes, record which image we want to show/hide. --- .../web/js/account/accountProxyItemsPanel.js | 30 ++++++------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/webapp/web/js/account/accountProxyItemsPanel.js b/webapp/web/js/account/accountProxyItemsPanel.js index fc354bd25..10fdbd006 100644 --- a/webapp/web/js/account/accountProxyItemsPanel.js +++ b/webapp/web/js/account/accountProxyItemsPanel.js @@ -188,38 +188,26 @@ $(document).ready(function() { //Add progress indicator for autocomplete input fields - var inputClick; + var progressImage; - $('#selectProfileEditors').click(function(){ - inputClick = ".loading-relateEditor"; + $('#selectProfileEditors').click(function(event){ + progressImage = $(event.target).closest("section").find(".loading-relateEditor") }); - $('#selectProfiles').click(function(){ - inputClick = ".loading-relateProfile"; + $('#selectProfiles').click(function(event){ + progressImage = $(event.target).closest("section").find(".loading-relateProfile") }); - $('#addProfile').click(function(){ - inputClick = ".loading-addProfile"; + $('#addProfile').click(function(event){ + progressImage = $(event.target).closest("section").find(".loading-addProfile") }); $(document).ajaxStart(function(){ - if (inputClick = ".loading-relateProfile"){ - $('.loading-relateProfile').removeClass('hidden').css('display', 'inline-block'); - }else if (inputClick = ".loading-addProfile"){ - $('.loading-addProfile').removeClass('hidden').css('display', 'inline-block'); - }else if (inputClick = ".loading-relateEditor"){ - $('.loading-relateEditor').removeClass('hidden').css('display', 'inline-block'); - } + progressImage.removeClass('hidden').css('display', 'inline-block'); }); $(document).ajaxStop(function(){ - if (inputClick = ".loading-relateProfile"){ - $('.loading-relateProfile').hide().addClass('hidden');; - }else if (inputClick = ".loading-addProfile"){ - $('.loading-addProfile').hide().addClass('hidden');; - }else if (inputClick = ".loading-relateEditor"){ - $('.loading-relateEditor').hide().addClass('hidden');; - } + progressImage.hide().addClass('hidden'); }); });