]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1712] Add buttons for managing proxy connectors rules as can be a pain with...
authorOlivier Lamy <olamy@apache.org>
Mon, 19 Nov 2012 15:23:03 +0000 (15:23 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 19 Nov 2012 15:23:03 +0000 (15:23 +0000)
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

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors-rules.js

index ef2b2e99b4a68cf37350209d16822539e5f7312b..e9a3489e9a1c3542fae05458c11fc43aef159873 100644 (file)
@@ -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){