]> source.dussan.org Git - sonarqube.git/commitdiff
improve modal windows
authorStas Vilchik <vilchiks@gmail.com>
Mon, 23 Feb 2015 08:44:44 +0000 (09:44 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 23 Feb 2015 09:23:47 +0000 (10:23 +0100)
server/sonar-web/src/main/hbs/coding-rules/coding-rules-bulk-change-modal.hbs
server/sonar-web/src/main/hbs/issue/issue-rule.hbs
server/sonar-web/src/main/hbs/nav/nav-shortcuts-help.hbs
server/sonar-web/src/main/hbs/source-viewer/source-viewer-measures.hbs
server/sonar-web/src/main/js/coding-rules/bulk-change-modal-view.js
server/sonar-web/src/main/js/common/modal-form.js
server/sonar-web/src/main/js/common/modals.js

index 28130ae5c8afd8bc48f7dee121c65dafb2a97e46..2da42ab924f3b51a67b4e7cc3bb6424f9b0647ae 100644 (file)
@@ -34,6 +34,6 @@
 
   <div class="modal-foot">
     <button id="coding-rules-submit-bulk-change">{{t 'apply'}}</button>
-    <a class="js-modal-close">{{t 'close'}}</a>
+    <a class="js-modal-close" href="#">{{t 'close'}}</a>
   </div>
 </form>
index 7d2348469bde919a6f9caaaaf8d09cb8e98cfde8..ab2a2dc93df062797b3c21e661644a24ac2aaef3 100644 (file)
@@ -28,5 +28,5 @@
 </div>
 
 <div class="modal-foot">
-  <a class="js-modal-close" title="{{t 'close'}}">{{t 'close'}}</a>
+  <a class="js-modal-close" href="#">{{t 'close'}}</a>
 </div>
index 0a7faf2acb1f7904380e57db1b44acb138ee1d86..74e10c7c0ae90fa6a932cb49a836b3334047fabc 100644 (file)
@@ -38,5 +38,5 @@
 </div>
 
 <div class="modal-foot">
-  <a class="js-modal-close">{{t 'close'}}</a>
+  <a class="js-modal-close" href="#">{{t 'close'}}</a>
 </div>
index deb19d374192094524a87b8341b0ba2c96e2efa0..0a2288ceca25c8163c34e026c9f87decd29da312 100644 (file)
@@ -64,5 +64,5 @@
 </div>
 
 <div class="modal-foot">
-  <a class="js-modal-close" title="{{t 'close'}}">{{t 'close'}}</a>
+  <a class="js-modal-close" href="#">{{t 'close'}}</a>
 </div>
index b75170d3bb623b9db2b0e39787ac5cfa029bf1f1..280a1927c14ad8636956de558e6df89ebbca3090 100644 (file)
@@ -63,6 +63,7 @@ define([
       looper.done(function () {
         that.options.app.controller.fetchList();
         that.$(that.ui.codingRulesSubmitBulkChange.selector).hide();
+        that.$('.js-modal-close').focus();
       });
     },
 
index 39fac08a7060c3402c50db931141c6be807bd06d..9cee5343443ba0d05de341a095aac7c739b2b7d6 100644 (file)
@@ -14,6 +14,14 @@ define(['common/modals'], function (ModalView) {
       });
     },
 
+    onRender: function () {
+      ModalView.prototype.onRender.apply(this, arguments);
+      var that = this;
+      setTimeout(function () {
+        that.$(':tabbable').first().focus();
+      }, 0);
+    },
+
     onFormSubmit: function (e) {
       e.preventDefault();
     },
index 6886465c001c605013c72219f9bf4c9494a45f42..d03c204788603269f9f5d1b7a97149f361164eb3 100644 (file)
@@ -10,7 +10,7 @@ define(function () {
 
     events: function () {
       return {
-        'click .js-modal-close': 'close'
+        'click .js-modal-close': 'onCloseClick'
       };
     },
 
@@ -46,6 +46,11 @@ define(function () {
       key.setScope(this.keyScope);
     },
 
+    onCloseClick: function (e) {
+      e.preventDefault();
+      this.close();
+    },
+
     renderOverlay: function () {
       var overlay = $('.' + this.overlayClassName);
       if (overlay.length === 0) {