From: Olivier Lamy Date: Mon, 19 Nov 2012 15:23:03 +0000 (+0000) Subject: [MRM-1712] Add buttons for managing proxy connectors rules as can be a pain with... X-Git-Tag: archiva-1.4-M4~616 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2f2b9cb22fa7a8da43b3980d3e982694f37973ca;p=archiva.git [MRM-1712] Add buttons for managing proxy connectors rules as can be a pain with long list of repositories. fix handling of click after a drag&drop. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1411244 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors-rules.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors-rules.js index ef2b2e99b..e9a3489e9 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors-rules.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors-rules.js @@ -175,14 +175,10 @@ define("archiva.proxy-connectors-rules",["jquery","i18n","jquery.tmpl","bootstra proxyConnectorRuleViewModel.activateRemoveAvailable(self); } - - remove=function(){ $.log("remove"); } - - } ProxyConnectorRuleViewModel=function(proxyConnectorRule,proxyConnectorRulesViewModel,update){ @@ -195,7 +191,7 @@ define("archiva.proxy-connectors-rules",["jquery","i18n","jquery.tmpl","bootstra $.each(this.proxyConnectorRulesViewModel.proxyConnectors(), function(idx, value) { - $.log(idx + ': ' + value.sourceRepoId() +":"+value.targetRepoId()); + //$.log(idx + ': ' + value.sourceRepoId() +":"+value.targetRepoId()); var available=true; // is it in proxyConnectorRule.proxyConnectors $.each(self.proxyConnectorRule.proxyConnectors(),function(index,proxyConnector){ @@ -212,6 +208,7 @@ define("archiva.proxy-connectors-rules",["jquery","i18n","jquery.tmpl","bootstra $.log("repositoryMoved:"+arg.sourceIndex+" to " + arg.targetIndex); self.proxyConnectorRule.modified(true); self.activateRemoveChoosen(self.proxyConnectorRulesViewModel); + self.activateRemoveAvailable(self.proxyConnectorRulesViewModel); } saveProxyConnectorRule=function(){ @@ -233,6 +230,9 @@ define("archiva.proxy-connectors-rules",["jquery","i18n","jquery.tmpl","bootstra self.proxyConnectorRule.proxyConnectors.remove(proxyConnectorToRemove); self.availableProxyConnectors.push(proxyConnectorToRemove); $.log("size after:"+self.proxyConnectorRule.proxyConnectors().length); + $("#main-content" ).find("#proxy-connectors-rules-available-proxy-connectors" ).find("[data-source-repoId="+sourceRepoId+"][data-target-repoId="+targetRepoId+"]" ).on("click", function(){ + self.removeAvailable(proxyConnectorRulesViewModel,$(this).attr("data-source-repoId"),$(this).attr("data-target-repoId")); + }); } this.activateRemoveChoosen=function(proxyConnectorRulesViewModel){ @@ -255,7 +255,10 @@ define("archiva.proxy-connectors-rules",["jquery","i18n","jquery.tmpl","bootstra } self.proxyConnectorRule.proxyConnectors.push(proxyConnectorToAdd); self.availableProxyConnectors.remove(proxyConnectorToAdd); - $.log("size after:"+self.proxyConnectorRule.proxyConnectors().length); + $.log("size after:"+self.availableProxyConnectors().length); + $("#main-content" ).find("#proxy-connectors-rules-edit-order-div" ).find("[data-source-repoId="+sourceRepoId+"][data-target-repoId="+targetRepoId+"]" ).on("click", function(){ + self.removeChoosen(proxyConnectorRulesViewModel,$(this).attr("data-source-repoId"),$(this).attr("data-target-repoId")); + }); } this.activateRemoveAvailable=function(proxyConnectorRulesViewModel){