diff Applications/StoneWebViewer/WebApplication/app.js @ 1561:cf652990abb1

tunable mouse actions
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 20 Aug 2020 17:44:35 +0200
parents 6d14ed6163b1
children 2a4a6b967053
line wrap: on
line diff
--- a/Applications/StoneWebViewer/WebApplication/app.js	Thu Aug 20 13:57:52 2020 +0200
+++ b/Applications/StoneWebViewer/WebApplication/app.js	Thu Aug 20 17:44:35 2020 +0200
@@ -104,6 +104,7 @@
       leftMode: 'grid',   // Can be 'small', 'grid' or 'full'
       leftVisible: true,
       viewportLayoutButtonsVisible: false,
+      mouseActionsVisible: false,
       activeViewport: 0,
       showInfo: true,
       showReferenceLines: true,
@@ -193,7 +194,7 @@
     }
   },
   methods: {
-    FitContent() {
+    FitContent: function() {
       // This function can be used even if WebAssembly is not initialized yet
       if (typeof stone._AllViewportsUpdateSize !== 'undefined') {
         this.$nextTick(function () {
@@ -202,7 +203,7 @@
       }
     },
     
-    GetActiveSeries() {
+    GetActiveSeries: function() {
       var s = [];
 
       if ('tags' in this.viewport1Series)
@@ -220,7 +221,7 @@
       return s;
     },
 
-    GetActiveCanvas() {
+    GetActiveCanvas: function() {
       if (this.activeViewport == 1) {
         return 'canvas1';
       }
@@ -445,48 +446,57 @@
       }
     },
 
-    SetWindowing(center, width) {
+    SetWindowing: function(center, width) {
       var canvas = this.GetActiveCanvas();
       if (canvas != '') {
         stone.SetWindowing(canvas, center, width);
       }
     },
 
-    SetDefaultWindowing() {
+    SetDefaultWindowing: function() {
       var canvas = this.GetActiveCanvas();
       if (canvas != '') {
         stone.SetDefaultWindowing(canvas);
       }
     },
 
-    InvertContrast() {
+    InvertContrast: function() {
       var canvas = this.GetActiveCanvas();
       if (canvas != '') {
         stone.InvertContrast(canvas);
       }
     },
 
-    FlipX() {
+    FlipX: function() {
       var canvas = this.GetActiveCanvas();
       if (canvas != '') {
         stone.FlipX(canvas);
       }
     },
 
-    FlipY() {
+    FlipY: function() {
       var canvas = this.GetActiveCanvas();
       if (canvas != '') {
         stone.FlipY(canvas);
       }
     },
 
-    ApplyPreferences() {
+    ApplyPreferences: function() {
       this.modalPreferences = false;
 
       if ((stone.IsSoftwareRendering() != 0) != this.settingSoftwareRendering) {
         document.location.reload();
       }
-    }
+    },
+
+    HideAllTooltips: function() {
+      $('[data-toggle="tooltip"]').tooltip('hide');
+    },
+
+    SetMouseButtonActions: function(left, middle, right) {
+      this.mouseActionsVisible = false;
+      stone.SetMouseButtonActions(left, middle, right);
+    }    
   },
   
   mounted: function() {
@@ -609,7 +619,11 @@
 
 $(document).ready(function() {
   // Enable support for tooltips in Bootstrap
-  //$('[data-toggle="tooltip"]').tooltip();
+  $('[data-toggle="tooltip"]').tooltip({
+    placement: 'bottom',
+    container: 'body',
+    trigger: 'hover'
+  });
 
   //app.modalWarning = true;