summaryrefslogtreecommitdiffstats
path: root/server/sonar-web
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-05-04 17:08:09 +0200
committerStas Vilchik <vilchiks@gmail.com>2015-05-04 17:12:28 +0200
commitd44b890a9e3cb980ba9ac5cbb30c30e40696c096 (patch)
tree1783fa782106a3f0251d0bb1e20f708dea7cf169 /server/sonar-web
parent251f4d5bce46fb9b57895e90c86e0e3dfbeb4bba (diff)
downloadsonarqube-d44b890a9e3cb980ba9ac5cbb30c30e40696c096.tar.gz
sonarqube-d44b890a9e3cb980ba9ac5cbb30c30e40696c096.zip
SONAR-6215 do not show tab for currently open item
Diffstat (limited to 'server/sonar-web')
-rw-r--r--server/sonar-web/src/main/js/workspace/main.js3
-rw-r--r--server/sonar-web/src/main/js/workspace/views/item-view.js12
2 files changed, 14 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/workspace/main.js b/server/sonar-web/src/main/js/workspace/main.js
index 594f8e783c2..6a468b36a7f 100644
--- a/server/sonar-web/src/main/js/workspace/main.js
+++ b/server/sonar-web/src/main/js/workspace/main.js
@@ -89,12 +89,15 @@ define([
showViewer: function (Viewer, model) {
var that = this;
if (this.viewerView != null) {
+ this.viewerView.model.trigger('hideViewer');
this.viewerView.close();
}
$('.source-viewer').addClass('with-workspace');
+ model.trigger('showViewer');
this.viewerView = new Viewer({ model: model });
this.viewerView
.on('viewerMinimize', function () {
+ model.trigger('hideViewer');
that.closeComponentViewer();
})
.on('viewerClose', function (m) {
diff --git a/server/sonar-web/src/main/js/workspace/views/item-view.js b/server/sonar-web/src/main/js/workspace/views/item-view.js
index fd176697611..ad593a73905 100644
--- a/server/sonar-web/src/main/js/workspace/views/item-view.js
+++ b/server/sonar-web/src/main/js/workspace/views/item-view.js
@@ -27,7 +27,9 @@ define([
template: Templates['workspace-item'],
modelEvents: {
- 'change': 'render'
+ 'change': 'render',
+ 'showViewer': 'onViewerShow',
+ 'hideViewer': 'onViewerHide'
},
events: {
@@ -44,6 +46,14 @@ define([
e.preventDefault();
e.stopPropagation();
this.model.destroy();
+ },
+
+ onViewerShow: function () {
+ this.$el.addClass('hidden');
+ },
+
+ onViewerHide: function () {
+ this.$el.removeClass('hidden');
}
});