Support loading for button and allow event listener to set it

currently gr-button supports `loading` but did not use it, this change will:

1. use disabled status when loading
2. add a spinner to show when loading is true
3. in repo-access component, set loading to true while promise ongoing
4. also fix the issue with non-zero initial tabindex for gr-button

screenshot: https://imgur.com/a/NCLwb45

Bug: 12421
Change-Id: Ie69c447455d23a118dbe1823c576144e0bca7c2d
diff --git a/polygerrit-ui/app/elements/admin/gr-repo-access/gr-repo-access.js b/polygerrit-ui/app/elements/admin/gr-repo-access/gr-repo-access.js
index b350702..02b62e0 100644
--- a/polygerrit-ui/app/elements/admin/gr-repo-access/gr-repo-access.js
+++ b/polygerrit-ui/app/elements/admin/gr-repo-access/gr-repo-access.js
@@ -442,21 +442,42 @@
       return obj;
     }
 
-    _handleSave() {
+    _handleSave(e) {
       const obj = this._getObjforSave();
       if (!obj) { return; }
+      const button = e && e.target;
+      if (button) {
+        button.loading = true;
+      }
       return this.$.restAPI.setRepoAccessRights(this.repo, obj)
           .then(() => {
             this._reload(this.repo);
+          })
+          .finally(() => {
+            this._modified = false;
+            if (button) {
+              button.loading = false;
+            }
           });
     }
 
-    _handleSaveForReview() {
+    _handleSaveForReview(e) {
       const obj = this._getObjforSave();
       if (!obj) { return; }
-      return this.$.restAPI.setRepoAccessRightsForReview(this.repo, obj)
+      const button = e && e.target;
+      if (button) {
+        button.loading = true;
+      }
+      return this.$.restAPI
+          .setRepoAccessRightsForReview(this.repo, obj)
           .then(change => {
             Gerrit.Nav.navigateToChange(change);
+          })
+          .finally(() => {
+            this._modified = false;
+            if (button) {
+              button.loading = false;
+            }
           });
     }