]> source.dussan.org Git - archiva.git/commitdiff
use bootstrap toggle button feature
authorOlivier Lamy <olamy@apache.org>
Fri, 28 Sep 2012 14:00:56 +0000 (14:00 +0000)
committerOlivier Lamy <olamy@apache.org>
Fri, 28 Sep 2012 14:00:56 +0000 (14:00 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1391470 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/general-admin.html

index c5c27397ab62b49d721056e5022ec25cbf9ca063..d1701d83623048d043439029f2d53d573cfb6302 100644 (file)
@@ -521,10 +521,12 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
     this.networkConfiguration=ko.observable(networkConfiguration);
 
     save=function(){
+      $("#user-messages" ).html(mediumSpinnerImg());
+      var mainContent=$("#main-content");
       if (!$("#main-content" ).find("#network-configuration-edit-form").valid()){
         return;
       }
-      clearUserMessages();
+      mainContent.find("#network-configuration-btn-save" ).button('loading');
       $.ajax("restServices/archivaServices/archivaAdministrationService/setNetworkConfiguration", {
         type: "POST",
         contentType: 'application/json',
@@ -532,6 +534,10 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
         dataType: 'json',
         success: function(data){
           displaySuccessMessage( $.i18n.prop("network-configuration.updated"));
+        },
+        complete: function(){
+          removeMediumSpinnerImg("#user-messages");
+          mainContent.find("#network-configuration-btn-save" ).button('reset');
         }
       });
     }
index 9b165d9936238cb1219c563f3476007e1f820ea6..77d2f61d04270bd8c924af78b63259c4c2cb58b9 100644 (file)
           </div>
         </div>
       </fieldset>
-      <button id="network-configuration-btn-save" data-bind="click: save" class="btn">${$.i18n.prop('save')}</button>
+      <button id="network-configuration-btn-save" data-loading-text="${$.i18n.prop('common.loading')}"
+              data-bind="click: save" class="btn">${$.i18n.prop('save')}</button>
     </form>
 </script>