loleaflet/src/control/Control.LokDialog.js | 25 +++++++++++-------------- loleaflet/src/layer/tile/TileLayer.js | 2 +- 2 files changed, 12 insertions(+), 15 deletions(-)
New commits: commit a2635cf2a9efa8fcd1206227f2d35a2220eda13b Author: Ashod Nakashian <[email protected]> AuthorDate: Wed Mar 25 23:24:19 2020 -0400 Commit: Andras Timar <[email protected]> CommitDate: Thu Mar 26 17:59:32 2020 +0100 leaflet: _isCalcInputBar -> isCalcInputBar Prepare for accessing isCalcInputBar from outside. Change-Id: I2cbeb1791ff263d830dd6a273d63108063bc2a57 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91084 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Andras Timar <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91137 Tested-by: Andras Timar <[email protected]> diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index 6057a6d25..5529abece 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -154,7 +154,7 @@ L.Control.LokDialog = L.Control.extend({ return (id in this._dialogs) && this._dialogs[id].isSidebar; }, - _isCalcInputBar: function(id) { + isCalcInputBar: function(id) { return (id in this._dialogs) && this._dialogs[id].isCalcInputBar; }, @@ -344,7 +344,7 @@ L.Control.LokDialog = L.Control.extend({ $('#' + strId).remove(); if (e.winType === 'deck' || this._isSidebar(e.id)) this._launchSidebar(e.id, width, height); - else if (e.winType === 'calc-input-win' || this._isCalcInputBar(e.id)) + else if (e.winType === 'calc-input-win' || this.isCalcInputBar(e.id)) this._launchCalcInputBar(e.id, width, height); else this._launchDialog(e.id, null, null, width, height, this._dialogs[parseInt(e.id)].title); @@ -398,7 +398,7 @@ L.Control.LokDialog = L.Control.extend({ this._onDialogChildClose(parent); else if (this._isSidebar(e.id)) this._onSidebarClose(e.id); - else if (this._isCalcInputBar(e.id)) + else if (this.isCalcInputBar(e.id)) this._onCalcInputBarClose(e.id); else this._onDialogClose(e.id, false); @@ -584,7 +584,7 @@ L.Control.LokDialog = L.Control.extend({ return; } } - else if (this._isCalcInputBar(dlgId) && (!this._isOpen(dlgId) || !this.isCursorVisible(dlgId))) { + else if (this.isCalcInputBar(dlgId) && (!this._isOpen(dlgId) || !this.isCursorVisible(dlgId))) { return; } @@ -923,7 +923,7 @@ L.Control.LokDialog = L.Control.extend({ }, _postLaunch: function(id, panelContainer, panelCanvas) { - if (!this._isCalcInputBar(id) || window.mode.isDesktop()) { + if (!this.isCalcInputBar(id) || window.mode.isDesktop()) { this._setupWindowEvents(id, panelCanvas/*, dlgInput*/); L.DomEvent.on(panelContainer, 'mouseleave', function () { @@ -1201,7 +1201,7 @@ L.Control.LokDialog = L.Control.extend({ _onClosePopups: function() { for (var dialogId in this._dialogs) { - if (!this._isSidebar(dialogId) && !this._isCalcInputBar(dialogId)) { + if (!this._isSidebar(dialogId) && !this.isCalcInputBar(dialogId)) { this._onDialogClose(dialogId, true); } } @@ -1210,7 +1210,7 @@ L.Control.LokDialog = L.Control.extend({ onCloseCurrentPopUp: function() { // for title-less dialog only (context menu, pop-up) if (this._currentId && this._isOpen(this._currentId) && - !this._dialogs[this._currentId].title && !this._isSidebar(this._currentId) && !this._isCalcInputBar(this._currentId)) + !this._dialogs[this._currentId].title && !this._isSidebar(this._currentId) && !this.isCalcInputBar(this._currentId)) this._onDialogClose(this._currentId, true); }, @@ -1270,7 +1270,7 @@ L.Control.LokDialog = L.Control.extend({ } // calc input bar find out their size on first paint call - var isCalcInputBar = that._isCalcInputBar(parentId); + var isCalcInputBar = that.isCalcInputBar(parentId); var container = L.DomUtil.get(strId); if (isCalcInputBar && container) { //console.log('_paintDialog: calc input bar: width: ' + that._calcInputBar.width); @@ -1304,7 +1304,7 @@ L.Control.LokDialog = L.Control.extend({ if (parentId in that._dialogs) { // We might have closed the dialog by the time we render. that._dialogs[parentId].isPainting = false; - if (!that._isSidebar(parentId) && !that._isCalcInputBar(parentId)) + if (!that._isSidebar(parentId) && !that.isCalcInputBar(parentId)) that._map.fire('changefocuswidget', {winId: parentId, dialog: that}); } }; @@ -1422,7 +1422,7 @@ L.Control.LokDialog = L.Control.extend({ _onDialogChildClose: function(dialogId) { $('#' + this._toStrId(dialogId) + '-floating').remove(); - if (!this._isSidebar(dialogId) && !this._isCalcInputBar(dialogId)) { + if (!this._isSidebar(dialogId) && !this.isCalcInputBar(dialogId)) { // Remove any extra height allocated for the parent container (only for floating dialogs). var canvas = document.getElementById(dialogId + '-canvas'); if (!canvas) { commit f70b9164ee66e8e4ceebf028aac30dc973d3658f Author: Ashod Nakashian <[email protected]> AuthorDate: Wed Mar 25 23:14:49 2020 -0400 Commit: Andras Timar <[email protected]> CommitDate: Thu Mar 26 17:59:17 2020 +0100 leaflet: add margin between sidebar and formula-bar And remove extra lastActiveTime reset. Change-Id: If7821e07fc61a54dc8caee5983198b475f43098c Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91083 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Andras Timar <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91136 Tested-by: Andras Timar <[email protected]> diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index 5d9edd5dc..6057a6d25 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -930,7 +930,6 @@ L.Control.LokDialog = L.Control.extend({ // Move the mouse off-screen when we leave the sidebar // so we don't leave edge-elements highlighted as if // the mouse is still over them. - this._map.lastActiveTime = Date.now(); this._postWindowMouseEvent('move', id, -1, -1, 1, 0, 0); }, this); } @@ -948,8 +947,6 @@ L.Control.LokDialog = L.Control.extend({ } var pos = this._isSelectionHandle(e.target) ? L.DomEvent.getMousePosition(e, canvas) : {x: e.offsetX, y: e.offsetY}; this._postWindowMouseEvent('move', id, pos.x, pos.y, 1, 0, 0); - // Keep map active while user is playing with sidebar/dialog. - this._map.lastActiveTime = Date.now(); }, this); L.DomEvent.on(canvas, 'mouseleave', function(e) { @@ -1284,7 +1281,7 @@ L.Control.LokDialog = L.Control.extend({ if (that._currentDeck) { var sidebar = L.DomUtil.get(that._currentDeck.strId); if (sidebar) { - deckOffset = sidebar.clientWidth; + deckOffset = sidebar.clientWidth + 10; // Allow some margin. } } var correctWidth = container.clientWidth - deckOffset; diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 4c35db6e4..d512813eb 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -1147,7 +1147,6 @@ L.TileLayer = L.GridLayer.extend({ }, _onInvalidateCursorMsg: function (textMsg) { - var docLayer = this._map._docLayer; textMsg = textMsg.substring('invalidatecursor:'.length + 1); var obj = JSON.parse(textMsg); var modifierViewId = parseInt(obj.viewId); @@ -1160,6 +1159,7 @@ L.TileLayer = L.GridLayer.extend({ this._twipsToLatLng(topLeftTwips, this._map.getZoom()), this._twipsToLatLng(bottomRightTwips, this._map.getZoom())); var cursorPos = this._visibleCursor.getNorthWest(); + var docLayer = this._map._docLayer; if ((docLayer._followEditor || docLayer._followUser) && this._map.lastActionByUser) { this._map._setFollowing(false, null); } _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
