]> source.dussan.org Git - archiva.git/commitdiff
correctly display spinner when loading network proxies
authorOlivier Lamy <olamy@apache.org>
Mon, 2 Apr 2012 12:38:33 +0000 (12:38 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 2 Apr 2012 12:38:33 +0000 (12:38 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1308322 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js

index d3ae125902c897f3fa9a07071752111c42121829..dbeb76a11236d806cb5c2a2ced5c7d6f459d1819 100644 (file)
@@ -204,60 +204,59 @@ define("archiva.network-proxies",["jquery","i18n","jquery.tmpl","bootstrap","jqu
     clearUserMessages();
     var mainContent = $("#main-content");
     mainContent.html(mediumSpinnerImg());
-    mainContent.html($("#networkProxiesMain").tmpl());
-    mainContent.find("#network-proxies-view-tabs a:first").tab('show');
-
-    var networkProxiesViewModel = new NetworkProxiesViewModel();
-
-    mainContent.find("#network-proxies-view-tabs").on('show', function (e) {
-      if ($(e.target).attr("href")=="#network-proxies-edit") {
-        var viewModel = new NetworkProxyViewModel(new NetworkProxy(),false,networkProxiesViewModel);
-        ko.applyBindings(viewModel,$("#main-content #network-proxies-edit").get(0));
-        activateNetworkProxyFormValidation();
-        clearUserMessages();
-      }
-      if ($(e.target).attr("href")=="#network-proxies-view") {
-        $("#main-content #network-proxies-view-tabs-li-edit a").html($.i18n.prop("add"));
-        clearUserMessages();
-      }
-
-    });
 
 
 
     loadNetworkProxies( function(data) {
-          networkProxiesViewModel.networkProxies(mapNetworkProxies(data));
-          networkProxiesViewModel.gridViewModel = new ko.simpleGrid.viewModel({
-            data: networkProxiesViewModel.networkProxies,
-            columns: [
-              {
-                headerText: $.i18n.prop('identifier'),
-                rowText: "id"
-              },
-              {
-                headerText: $.i18n.prop('protocol'),
-                rowText: "protocol"
-              },
-              {
-              headerText: $.i18n.prop('host'),
-              rowText: "host"
-              },
-              {
-              headerText: $.i18n.prop('port'),
-              rowText: "port"
-              },
-              {
-              headerText: $.i18n.prop('username'),
-              rowText: "username"
-              }
-            ],
-            pageSize: 5,
-            gridUpdateCallBack: function(networkProxy){
-              $("#main-content #networkProxiesTable [title]").tooltip();
+        var networkProxiesViewModel = new NetworkProxiesViewModel();
+        mainContent.html($("#networkProxiesMain").tmpl());
+        mainContent.find("#network-proxies-view-tabs a:first").tab('show');
+
+        mainContent.find("#network-proxies-view-tabs").on('show', function (e) {
+          if ($(e.target).attr("href")=="#network-proxies-edit") {
+            var viewModel = new NetworkProxyViewModel(new NetworkProxy(),false,networkProxiesViewModel);
+            ko.applyBindings(viewModel,$("#main-content #network-proxies-edit").get(0));
+            activateNetworkProxyFormValidation();
+            clearUserMessages();
+          }
+          if ($(e.target).attr("href")=="#network-proxies-view") {
+            $("#main-content #network-proxies-view-tabs-li-edit a").html($.i18n.prop("add"));
+            clearUserMessages();
+          }
+
+        });
+        networkProxiesViewModel.networkProxies(mapNetworkProxies(data));
+        networkProxiesViewModel.gridViewModel = new ko.simpleGrid.viewModel({
+          data: networkProxiesViewModel.networkProxies,
+          columns: [
+            {
+              headerText: $.i18n.prop('identifier'),
+              rowText: "id"
+            },
+            {
+              headerText: $.i18n.prop('protocol'),
+              rowText: "protocol"
+            },
+            {
+            headerText: $.i18n.prop('host'),
+            rowText: "host"
+            },
+            {
+            headerText: $.i18n.prop('port'),
+            rowText: "port"
+            },
+            {
+            headerText: $.i18n.prop('username'),
+            rowText: "username"
             }
-          });
-          ko.applyBindings(networkProxiesViewModel,$("#main-content #network-proxies-view").get(0));
-        }
+          ],
+          pageSize: 5,
+          gridUpdateCallBack: function(networkProxy){
+            $("#main-content #networkProxiesTable [title]").tooltip();
+          }
+        });
+        ko.applyBindings(networkProxiesViewModel,$("#main-content #network-proxies-view").get(0));
+      }
     )
   }