aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/components/workspace/views/viewer-header-view.js
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2018-03-14 12:47:17 +0100
committerGitHub <noreply@github.com>2018-03-14 12:47:17 +0100
commit6f189a7c95ee207e02c7c9321ed37d0c6ca4afe6 (patch)
tree494c72690c0ac9607716574a5bfa49f9c4ca315a /server/sonar-web/src/main/js/components/workspace/views/viewer-header-view.js
parent47d50b8a9c17d595a07b6a7e157849ccf1ffc302 (diff)
downloadsonarqube-6f189a7c95ee207e02c7c9321ed37d0c6ca4afe6.tar.gz
sonarqube-6f189a7c95ee207e02c7c9321ed37d0c6ca4afe6.zip
rewrite workspace in react (#3140)
Diffstat (limited to 'server/sonar-web/src/main/js/components/workspace/views/viewer-header-view.js')
-rw-r--r--server/sonar-web/src/main/js/components/workspace/views/viewer-header-view.js110
1 files changed, 0 insertions, 110 deletions
diff --git a/server/sonar-web/src/main/js/components/workspace/views/viewer-header-view.js b/server/sonar-web/src/main/js/components/workspace/views/viewer-header-view.js
deleted file mode 100644
index 756ede70c71..00000000000
--- a/server/sonar-web/src/main/js/components/workspace/views/viewer-header-view.js
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2018 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-import $ from 'jquery';
-import Marionette from 'backbone.marionette';
-import Template from '../templates/workspace-viewer-header.hbs';
-
-export default Marionette.ItemView.extend({
- template: Template,
-
- modelEvents: {
- change: 'render'
- },
-
- events: {
- 'mousedown .js-resize': 'onResizeClick',
-
- 'click .js-minimize': 'onMinimizeClick',
- 'click .js-full-screen': 'onFullScreenClick',
- 'click .js-normal-size': 'onNormalSizeClick',
- 'click .js-close': 'onCloseClick'
- },
-
- onRender() {
- this.$('[data-toggle="tooltip"]').tooltip({ container: 'body' });
- this.$('.js-normal-size').addClass('hidden');
- },
-
- onDestroy() {
- this.$('[data-toggle="tooltip"]').tooltip('destroy');
- $('.tooltip').remove();
- },
-
- onResizeClick(e) {
- e.preventDefault();
- this.startResizing(e);
- },
-
- onMinimizeClick(e) {
- e.preventDefault();
- this.trigger('viewerMinimize');
- },
-
- onFullScreenClick(e) {
- e.preventDefault();
- this.toFullScreen();
- },
-
- onNormalSizeClick(e) {
- e.preventDefault();
- this.toNormalSize();
- },
-
- onCloseClick(e) {
- e.preventDefault();
- this.trigger('viewerClose');
- },
-
- startResizing(e) {
- this.initialResizePosition = e.clientY;
- this.initialResizeHeight = $('.workspace-viewer-container').height();
- const processResizing = this.processResizing.bind(this);
- const stopResizing = this.stopResizing.bind(this);
- $('body')
- .on('mousemove.workspace', processResizing)
- .on('mouseup.workspace', stopResizing);
- },
-
- processResizing(e) {
- const currentResizePosition = e.clientY;
- const resizeDelta = this.initialResizePosition - currentResizePosition;
- const height = this.initialResizeHeight + resizeDelta;
- $('.workspace-viewer-container').height(height);
- },
-
- stopResizing() {
- $('body')
- .off('mousemove.workspace')
- .off('mouseup.workspace');
- },
-
- toFullScreen() {
- this.$('.js-normal-size').removeClass('hidden');
- this.$('.js-full-screen').addClass('hidden');
- this.initialResizeHeight = $('.workspace-viewer-container').height();
- $('.workspace-viewer-container').height('9999px');
- },
-
- toNormalSize() {
- this.$('.js-normal-size').addClass('hidden');
- this.$('.js-full-screen').removeClass('hidden');
- $('.workspace-viewer-container').height(this.initialResizeHeight);
- }
-});