aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-02-23 09:44:44 +0100
committerStas Vilchik <vilchiks@gmail.com>2015-02-23 10:23:47 +0100
commitaacf4f3de8ccbcf83407ae75e1e2063bf63e0cc8 (patch)
treec31dadd5ad1e5ea7290f291ef957a87bb7938247
parent18241ecfcac41c79414c83f359aa4c5aab24c56d (diff)
downloadsonarqube-aacf4f3de8ccbcf83407ae75e1e2063bf63e0cc8.tar.gz
sonarqube-aacf4f3de8ccbcf83407ae75e1e2063bf63e0cc8.zip
improve modal windows
-rw-r--r--server/sonar-web/src/main/hbs/coding-rules/coding-rules-bulk-change-modal.hbs2
-rw-r--r--server/sonar-web/src/main/hbs/issue/issue-rule.hbs2
-rw-r--r--server/sonar-web/src/main/hbs/nav/nav-shortcuts-help.hbs2
-rw-r--r--server/sonar-web/src/main/hbs/source-viewer/source-viewer-measures.hbs2
-rw-r--r--server/sonar-web/src/main/js/coding-rules/bulk-change-modal-view.js1
-rw-r--r--server/sonar-web/src/main/js/common/modal-form.js8
-rw-r--r--server/sonar-web/src/main/js/common/modals.js7
7 files changed, 19 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/hbs/coding-rules/coding-rules-bulk-change-modal.hbs b/server/sonar-web/src/main/hbs/coding-rules/coding-rules-bulk-change-modal.hbs
index 28130ae5c8a..2da42ab924f 100644
--- a/server/sonar-web/src/main/hbs/coding-rules/coding-rules-bulk-change-modal.hbs
+++ b/server/sonar-web/src/main/hbs/coding-rules/coding-rules-bulk-change-modal.hbs
@@ -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>
diff --git a/server/sonar-web/src/main/hbs/issue/issue-rule.hbs b/server/sonar-web/src/main/hbs/issue/issue-rule.hbs
index 7d2348469bd..ab2a2dc93df 100644
--- a/server/sonar-web/src/main/hbs/issue/issue-rule.hbs
+++ b/server/sonar-web/src/main/hbs/issue/issue-rule.hbs
@@ -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>
diff --git a/server/sonar-web/src/main/hbs/nav/nav-shortcuts-help.hbs b/server/sonar-web/src/main/hbs/nav/nav-shortcuts-help.hbs
index 0a7faf2acb1..74e10c7c0ae 100644
--- a/server/sonar-web/src/main/hbs/nav/nav-shortcuts-help.hbs
+++ b/server/sonar-web/src/main/hbs/nav/nav-shortcuts-help.hbs
@@ -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>
diff --git a/server/sonar-web/src/main/hbs/source-viewer/source-viewer-measures.hbs b/server/sonar-web/src/main/hbs/source-viewer/source-viewer-measures.hbs
index deb19d37419..0a2288ceca2 100644
--- a/server/sonar-web/src/main/hbs/source-viewer/source-viewer-measures.hbs
+++ b/server/sonar-web/src/main/hbs/source-viewer/source-viewer-measures.hbs
@@ -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>
diff --git a/server/sonar-web/src/main/js/coding-rules/bulk-change-modal-view.js b/server/sonar-web/src/main/js/coding-rules/bulk-change-modal-view.js
index b75170d3bb6..280a1927c14 100644
--- a/server/sonar-web/src/main/js/coding-rules/bulk-change-modal-view.js
+++ b/server/sonar-web/src/main/js/coding-rules/bulk-change-modal-view.js
@@ -63,6 +63,7 @@ define([
looper.done(function () {
that.options.app.controller.fetchList();
that.$(that.ui.codingRulesSubmitBulkChange.selector).hide();
+ that.$('.js-modal-close').focus();
});
},
diff --git a/server/sonar-web/src/main/js/common/modal-form.js b/server/sonar-web/src/main/js/common/modal-form.js
index 39fac08a706..9cee5343443 100644
--- a/server/sonar-web/src/main/js/common/modal-form.js
+++ b/server/sonar-web/src/main/js/common/modal-form.js
@@ -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();
},
diff --git a/server/sonar-web/src/main/js/common/modals.js b/server/sonar-web/src/main/js/common/modals.js
index 6886465c001..d03c2047886 100644
--- a/server/sonar-web/src/main/js/common/modals.js
+++ b/server/sonar-web/src/main/js/common/modals.js
@@ -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) {