loleaflet/src/control/Control.TopToolbar.js |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 58a9142907a6387389f52168ca24233087dd7f9e
Author:     Tor Lillqvist <t...@collabora.com>
AuthorDate: Wed Sep 16 16:04:31 2020 +0300
Commit:     Tor Lillqvist <t...@collabora.com>
CommitDate: Wed Sep 16 15:51:39 2020 +0200

    Make the 'modifypage' button work on first tap in iOS app
    
    Horrible hack: Could not figure out the root cause, so just pretend
    the user tapped twice then the first time.
    
    This is not intended to fix tdf#136457 though. But it might still have
    some effect on that whole can of worms. That bug is hard to reproduce
    or even descibe exactly, so it is hard to say.
    
    Change-Id: I147a448cceb0adc25fa5d136d59bfebf91839aaf
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102872
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Tor Lillqvist <t...@collabora.com>

diff --git a/loleaflet/src/control/Control.TopToolbar.js 
b/loleaflet/src/control/Control.TopToolbar.js
index 51322b5f8..af271b21f 100644
--- a/loleaflet/src/control/Control.TopToolbar.js
+++ b/loleaflet/src/control/Control.TopToolbar.js
@@ -1,4 +1,4 @@
-/* -*- js-indent-level: 8 -*- */
+/* -*- js-indent-level: 8; fill-column: 100 -*- */
 /*
  * L.Control.TopToolbar
  */
@@ -237,6 +237,16 @@ L.Control.TopToolbar = L.Control.extend({
                        name: 'editbar',
                        items: this.getToolItems(),
                        onClick: function (e) {
+                               if (window.ThisIsTheiOSApp && e.target === 
'modifypage' && window.ModifyPageTapped === undefined) {
+                                       // Horrible hack. I can't figure out 
why it needs two taps
+                                       // to display initially, so call this 
an extra time for the
+                                       // first tap. And for some reason I 
need to do it after a
+                                       // short timeout.
+                                       setTimeout(function() {
+                                               window.onClick(e, e.target);
+                                       }, 100);
+                                       window.ModifyPageTapped = true;
+                               }
                                window.onClick(e, e.target);
                                window.hideTooltip(this, e.target);
                        },
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to