diff --git a/nunaliit2-js/src/main/js/nunaliit2/n2.couchDisplayTiles.js b/nunaliit2-js/src/main/js/nunaliit2/n2.couchDisplayTiles.js index 4b266feee..8acf9615e 100644 --- a/nunaliit2-js/src/main/js/nunaliit2/n2.couchDisplayTiles.js +++ b/nunaliit2-js/src/main/js/nunaliit2/n2.couchDisplayTiles.js @@ -230,6 +230,8 @@ var TiledDisplay = $n2.Class({ this.customService = opts.customService; this.dispatchService = opts.dispatchService; this.createDocProcess = opts.createDocProcess; + + this.noDocumentHoverFunctions = false; // Initialize display this._getDisplayDiv(); @@ -246,6 +248,10 @@ var TiledDisplay = $n2.Class({ this.customService.getOption('restrictAddRelatedButtonToLoggedIn',false); }; + if (this.customService) { + this.noDocumentHoverFunctions = this.customService.getOption('disableDocumentHoverFunctions', false) + } + var dispatcher = this.dispatchService; if( dispatcher ) { var f = function(msg, addr, d){ @@ -364,28 +370,34 @@ var TiledDisplay = $n2.Class({ }; // Hover in and out - this.hoverInFn = function(){ - var $tile = $(this); - var docId = $tile.attr('n2DocId'); - if( docId && docId !== _this.hoverDocId ) { - _this.hoverDocId = docId; - _this._dispatch({ - type: 'userFocusOn' - ,docId: docId - }); + if (this.noDocumentHoverFunctions) { + this.hoverInFn = () => {} + this.hoverOutFn = () => {} + } + else { + this.hoverInFn = function(){ + var $tile = $(this); + var docId = $tile.attr('n2DocId'); + if( docId && docId !== _this.hoverDocId ) { + _this.hoverDocId = docId; + _this._dispatch({ + type: 'userFocusOn' + ,docId: docId + }); + }; }; - }; - this.hoverOutFn = function(){ - var $tile = $(this); - var docId = $tile.attr('n2DocId'); - if( docId && docId === _this.hoverDocId ) { - _this.hoverDocId = null; - _this._dispatch({ - type: 'userFocusOff' - ,docId: docId - }); + this.hoverOutFn = function(){ + var $tile = $(this); + var docId = $tile.attr('n2DocId'); + if( docId && docId === _this.hoverDocId ) { + _this.hoverDocId = null; + _this._dispatch({ + type: 'userFocusOff' + ,docId: docId + }); + }; }; - }; + } // Detect changes in displayed current content size var intervalID = window.setInterval(function(){ diff --git a/nunaliit2-js/src/main/js/nunaliit2/n2.displayRibbon.js b/nunaliit2-js/src/main/js/nunaliit2/n2.displayRibbon.js index 535dd457b..c49c7e30e 100644 --- a/nunaliit2-js/src/main/js/nunaliit2/n2.displayRibbon.js +++ b/nunaliit2-js/src/main/js/nunaliit2/n2.displayRibbon.js @@ -1212,6 +1212,8 @@ var RibbonDisplay = $n2.Class('RibbonDisplay', { this.customService = opts.customService; this.dispatchService = opts.dispatchService; this.createDocProcess = opts.createDocProcess; + + this.noDocumentHoverFunctions = false; // Initialize display this._getDisplayDiv(); @@ -1270,6 +1272,10 @@ var RibbonDisplay = $n2.Class('RibbonDisplay', { documentSource: this.documentSource }); }; + + if (this.customService) { + this.noDocumentHoverFunctions = this.customService.getOption('disableDocumentHoverFunctions', false) + } // Document info function this.documentInfoFunction = opts.documentInfoFunction; @@ -1347,16 +1353,22 @@ var RibbonDisplay = $n2.Class('RibbonDisplay', { }; // Hover in and out - this.hoverInFn = function(){ - var $tile = $(this); - _this._hoverInTile($tile); - return false; - }; - this.hoverOutFn = function(){ - var $tile = $(this); - _this._hoverOutTile($tile); - return false; - }; + if (this.noDocumentHoverFunctions) { + this.hoverInFn = () => {} + this.hoverOutFn = () => {} + } + else { + this.hoverInFn = function(){ + var $tile = $(this); + _this._hoverInTile($tile); + return false; + }; + this.hoverOutFn = function(){ + var $tile = $(this); + _this._hoverOutTile($tile); + return false; + }; + } // Click function this.clickFn = function(e){ diff --git a/nunaliit2-js/src/main/js/nunaliit2/n2.displayRibbon2.js b/nunaliit2-js/src/main/js/nunaliit2/n2.displayRibbon2.js index e0e4b68cc..bfe4a33ab 100644 --- a/nunaliit2-js/src/main/js/nunaliit2/n2.displayRibbon2.js +++ b/nunaliit2-js/src/main/js/nunaliit2/n2.displayRibbon2.js @@ -1288,6 +1288,8 @@ var RibbonDisplay = $n2.Class('RibbonDisplay', { this.customService = opts.customService; this.dispatchService = opts.dispatchService; this.createDocProcess = opts.createDocProcess; + + this.noDocumentHoverFunctions = false; // Initialize display this._getDisplayDiv(); @@ -1345,6 +1347,10 @@ var RibbonDisplay = $n2.Class('RibbonDisplay', { documentSource: this.documentSource }); }; + + if (this.customService) { + this.noDocumentHoverFunctions = this.customService.getOption('disableDocumentHoverFunctions', false) + } // Document info function this.documentInfoFunction = opts.documentInfoFunction; @@ -1422,16 +1428,22 @@ var RibbonDisplay = $n2.Class('RibbonDisplay', { }; // Hover in and out - this.hoverInFn = function(){ - var $tile = $(this); - _this._hoverInTile($tile); - return false; - }; - this.hoverOutFn = function(){ - var $tile = $(this); - _this._hoverOutTile($tile); - return false; - }; + if (this.noDocumentHoverFunctions) { + this.hoverInFn = () => {} + this.hoverOutFn = () => {} + } + else { + this.hoverInFn = function(){ + var $tile = $(this); + _this._hoverInTile($tile); + return false; + }; + this.hoverOutFn = function(){ + var $tile = $(this); + _this._hoverOutTile($tile); + return false; + }; + } // Click function this.clickFn = function(){