[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3' - loleaflet/src
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Sep 10 20:53:48 UTC 2018
loleaflet/src/control/Toolbar.js | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
New commits:
commit 8464c97390e57bfc14177dc8583e2b659c612cc1
Author: George Wood <gwoodcode at gmail.com>
AuthorDate: Tue Jul 24 12:19:52 2018 +0100
Commit: Michael Meeks <michael.meeks at collabora.com>
CommitDate: Mon Sep 10 22:53:29 2018 +0200
enables debug mode to be turned on from the about screen by pressing d.
Also fixes focus issue with map after closing dialog.
Change-Id: I81b57f552b7ab66d3cdf19d140779efb249cd8d9
Reviewed-on: https://gerrit.libreoffice.org/60295
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
Tested-by: Michael Meeks <michael.meeks at collabora.com>
diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index d417d3dbd..c6c4fc4ba 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -1,3 +1,4 @@
+/* -*- js-indent-level: 8 -*- */
/*
* Toolbar handler
*/
@@ -185,6 +186,7 @@ L.Map.include({
contentCSS: {width: w + 'px'},
buttons: {},
afterOpen: function($vexContent) {
+ map.enable(false);
// Display help according to document opened
if (map.getDocType() === 'text') {
document.getElementById('text-shortcuts').style.display='block';
@@ -196,7 +198,7 @@ L.Map.include({
document.getElementById('presentation-shortcuts').style.display='block';
}
- // Lets transalte
+ // Lets translate
var i, max;
var translatableContent = $vexContent.find('h1');
for (i = 0, max = translatableContent.length; i < max; i++) {
@@ -228,6 +230,7 @@ L.Map.include({
},
beforeClose: function () {
map.focus();
+ map.enable(true);
}
});
});
@@ -242,6 +245,12 @@ L.Map.include({
var productString = _('This version of %productName is powered by');
content.find('#product-string').text(productString.replace('%productName', productName));
var w = window.innerWidth / 2;
+ var map = this;
+ var handler = function(event) {
+ if (event.keyCode === 68) {
+ map._docLayer.toggleTileDebugMode();
+ }
+ };
vex.open({
content: content,
showCloseButton: true,
@@ -251,6 +260,7 @@ L.Map.include({
buttons: {},
afterOpen: function($vexContent) {
map.enable(false);
+ $(window).bind('keyup.vex', handler);
// workaround for https://github.com/HubSpot/vex/issues/43
$('.vex-overlay').css({ 'pointer-events': 'none'});
$('.vex').click(function() {
@@ -261,7 +271,9 @@ L.Map.include({
});
},
beforeClose: function () {
+ $(window).unbind('keyup.vex', handler)
map.enable(true);
+ map.focus();
}
});
}
More information about the Libreoffice-commits
mailing list