[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-1-0' - 4 commits - loleaflet/src
Pranav Kant
pranavk at collabora.com
Sun Jun 19 06:51:33 UTC 2016
loleaflet/src/control/Control.Menubar.js | 8 ++++++++
loleaflet/src/control/Control.Scroll.js | 10 +++++++---
2 files changed, 15 insertions(+), 3 deletions(-)
New commits:
commit e92a36f2449c29f8fde173afb1e9274a064fb325
Author: Pranav Kant <pranavk at collabora.com>
Date: Sun Jun 19 01:04:55 2016 +0530
loleaflet: bccu#1887: Enable keyevents on menubar
Make it focusable. This also enables ESC key to reset the opened
menu.
Change-Id: Ia7be49af45b25ae7d29a5ba95b83591af0d82dca
(cherry picked from commit 76178f22e568c2603419bdebfe081bc8e4bbb076)
diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index d383728..d655c5f 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -178,6 +178,7 @@ L.Control.Menubar = L.Control.extend({
subIndicatorsPos: 'append',
subIndicatorsText: '›'
});
+ $('#main-menu').attr('tabindex', 0);
this._initialized = true;
$('#main-menu').bind('select.smapi', {self: this}, this._onItemSelected);
commit 25ba39d8ba55a0c31c2be797b59ec93fa1cba0e5
Author: Pranav Kant <pranavk at collabora.com>
Date: Sun Jun 19 01:04:47 2016 +0530
loleaflet: Hide its submenu when clicked over highlighted menu
Change-Id: Id1249e5d4a0d2013e1dd2a5f8833b3b787b1a137
(cherry picked from commit 3de264c3fdb6bced35eaaa2971f075d118ff0cb1)
diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index 563cc67..d383728 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -182,6 +182,13 @@ L.Control.Menubar = L.Control.extend({
$('#main-menu').bind('select.smapi', {self: this}, this._onItemSelected);
$('#main-menu').bind('beforeshow.smapi', {self: this}, this._beforeShow);
+ $('#main-menu').bind('click.smapi', {self: this}, this._onClicked);
+ },
+
+ _onClicked: function(e, menu) {
+ if ($(menu).hasClass('highlighted')) {
+ $('#main-menu').smartmenus('menuHideAll');
+ }
},
_beforeShow: function(e, menu) {
commit f076991d4c3040b29155db9ee8f8af1523e25f3e
Author: Pranav Kant <pranavk at collabora.com>
Date: Fri Jun 17 10:00:12 2016 +0530
loleaflet: bccu#1867: Do not scroll first time after doc resizes
This was removed in c7588f0e8c194539e65fb8858fae02522237170a in
an effort to fix calc row/col offset where it must not be ignored to
have aligned row/col offset without any side-effects that one can
have in single-part documents like writer.
Earlier approach using a timer of 200 ms for 'scroll ignore' also
doesn't seem very effective, so change it to: ignoring the first
'whileScrolling' invocation.
Change-Id: Ic3a6868a279fc200b8f9fee74bb40aebad5d9646
(cherry picked from commit 50a237dd294cd83633ab4965fdb04c1469b2f9b2)
diff --git a/loleaflet/src/control/Control.Scroll.js b/loleaflet/src/control/Control.Scroll.js
index 1ce203f..b5e6b1b 100644
--- a/loleaflet/src/control/Control.Scroll.js
+++ b/loleaflet/src/control/Control.Scroll.js
@@ -36,6 +36,7 @@ L.Control.Scroll = L.Control.extend({
_onScroll: function (e) {
if (this._ignoreScroll) {
+ this._ignoreScroll = null;
return;
}
if (this._prevScrollY === undefined) {
@@ -113,10 +114,14 @@ L.Control.Scroll = L.Control.extend({
},
_onUpdateSize: function (e) {
- this._ignoreScroll = true;
+ // for writer documents, ignore scroll while document size is being reduced
+ var prevDocY = parseFloat(L.DomUtil.getStyle(this._mockDoc, 'height'));
+ if (this._map.getDocType() === 'text' && e.y < prevDocY) {
+ this._ignoreScroll = true;
+ }
+
L.DomUtil.setStyle(this._mockDoc, 'width', e.x + 'px');
L.DomUtil.setStyle(this._mockDoc, 'height', e.y + 'px');
- this._ignoreScroll = null;
},
_onUpdateScrollOffset: function (e) {
commit 52e4c5f64486de189d839d5ca172c7f6108059da
Author: Pranav Kant <pranavk at collabora.com>
Date: Fri Jun 17 09:18:26 2016 +0530
loleaflet: Remove superfluous call
Option 'updateOnContentResize' is true by default, which means
this method is called automatically when scroll container is
resized, so no need to manually call it again.
Change-Id: Ie80e90239752acb119e3a92c09a1f77dd61b2ad4
(cherry picked from commit be6acfcd4e0dd5830530e73b5261e03b4c9e9bf5)
diff --git a/loleaflet/src/control/Control.Scroll.js b/loleaflet/src/control/Control.Scroll.js
index 8cc7dcb..1ce203f 100644
--- a/loleaflet/src/control/Control.Scroll.js
+++ b/loleaflet/src/control/Control.Scroll.js
@@ -116,7 +116,6 @@ L.Control.Scroll = L.Control.extend({
this._ignoreScroll = true;
L.DomUtil.setStyle(this._mockDoc, 'width', e.x + 'px');
L.DomUtil.setStyle(this._mockDoc, 'height', e.y + 'px');
- $('.scroll-container').mCustomScrollbar('update');
this._ignoreScroll = null;
},
More information about the Libreoffice-commits
mailing list