From 32a3e071bf24d0122d173519c6026b9b6540e055 Mon Sep 17 00:00:00 2001 From: PhilW Date: Sat, 3 Feb 2018 19:10:39 +0000 Subject: [PATCH] fix small display bug in empty message list on android --- skins/elastic/swipe.less | 4 ++++ skins/elastic/swipe.min.css | 2 +- swipe.js | 6 +++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/skins/elastic/swipe.less b/skins/elastic/swipe.less index 8e3303e..9e6fd84 100644 --- a/skins/elastic/swipe.less +++ b/skins/elastic/swipe.less @@ -140,4 +140,8 @@ #messagelist.swipe-active { height: 100%; + + &.swipe-block { + display: block; + } } \ No newline at end of file diff --git a/skins/elastic/swipe.min.css b/skins/elastic/swipe.min.css index 3670514..250187b 100644 --- a/skins/elastic/swipe.min.css +++ b/skins/elastic/swipe.min.css @@ -1 +1 @@ -#swipe-action{position:absolute;background-color:#f1f3f4;color:#161b1d;display:flex;align-items:center;border-collapse:collapse}#swipe-action.checkmail,#swipe-action.select,#swipe-action.deselect{background-color:#8b9fa7;color:#fff}#swipe-action.delete,#swipe-action.junk{background-color:#ff5552;color:#fff}#swipe-action.flagged,#swipe-action.unflagged,#swipe-action.read,#swipe-action.unread{background-color:#37beff;color:#fff}#swipe-action.forward,#swipe-action.reply,#swipe-action.replyall{background-color:#41b849;color:#fff}#swipe-action.move,#swipe-action.archive{background-color:#ffd452;color:#fff}#swipe-action>div.left{position:absolute;right:.5em}#swipe-action>div.down{margin:0 auto}#swipe-action>div.down>span::before{width:auto;float:none;margin:0;margin-bottom:.2em;padding:0}#swipe-action>div>span{line-height:100%;font-size:1.2em}#swipe-action>div>span::before{font-size:1.25em;display:block;float:left;margin:0 .25rem 0 0;width:1.18em;height:1em;font-family:'Icons';font-style:normal;font-weight:900;text-decoration:inherit;text-align:center;speak:none;font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;padding:0 1.25em 0 .5em}#swipe-action>div>span.checkmail::before{content:"\f021"}#swipe-action>div>span.delete::before{content:"\f2ed"}#swipe-action>div>span.flagged::before{content:"\f024"}#swipe-action>div>span.forward::before{content:"\f064"}#swipe-action>div>span.unflagged::before{content:"\f024";font-weight:400}#swipe-action>div>span.move::before{content:"\f0b2"}#swipe-action>div>span.read::before{content:"\f005";font-weight:400}#swipe-action>div>span.unread::before{content:"\f005"}#swipe-action>div>span.reply::before{content:"\f3e5"}#swipe-action>div>span.replyall::before{content:"\f122"}#swipe-action>div>span.select::before{content:"\f14a";font-weight:400}#swipe-action>div>span.deselect::before{content:"\f0c8";font-weight:400}#swipe-action>div>span.archive::before{content:"\f187"}#swipe-action>div>span.junk::before{content:"\f06d"}.swipe-active,.swipe-active>td{background-color:#fff}#messagelist.swipe-active{height:100%} \ No newline at end of file +#swipe-action{position:absolute;background-color:#f1f3f4;color:#161b1d;display:flex;align-items:center;border-collapse:collapse}#swipe-action.checkmail,#swipe-action.select,#swipe-action.deselect{background-color:#8b9fa7;color:#fff}#swipe-action.delete,#swipe-action.junk{background-color:#ff5552;color:#fff}#swipe-action.flagged,#swipe-action.unflagged,#swipe-action.read,#swipe-action.unread{background-color:#37beff;color:#fff}#swipe-action.forward,#swipe-action.reply,#swipe-action.replyall{background-color:#41b849;color:#fff}#swipe-action.move,#swipe-action.archive{background-color:#ffd452;color:#fff}#swipe-action>div.left{position:absolute;right:.5em}#swipe-action>div.down{margin:0 auto}#swipe-action>div.down>span::before{width:auto;float:none;margin:0;margin-bottom:.2em;padding:0}#swipe-action>div>span{line-height:100%;font-size:1.2em}#swipe-action>div>span::before{font-size:1.25em;display:block;float:left;margin:0 .25rem 0 0;width:1.18em;height:1em;font-family:'Icons';font-style:normal;font-weight:900;text-decoration:inherit;text-align:center;speak:none;font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;padding:0 1.25em 0 .5em}#swipe-action>div>span.checkmail::before{content:"\f021"}#swipe-action>div>span.delete::before{content:"\f2ed"}#swipe-action>div>span.flagged::before{content:"\f024"}#swipe-action>div>span.forward::before{content:"\f064"}#swipe-action>div>span.unflagged::before{content:"\f024";font-weight:400}#swipe-action>div>span.move::before{content:"\f0b2"}#swipe-action>div>span.read::before{content:"\f005";font-weight:400}#swipe-action>div>span.unread::before{content:"\f005"}#swipe-action>div>span.reply::before{content:"\f3e5"}#swipe-action>div>span.replyall::before{content:"\f122"}#swipe-action>div>span.select::before{content:"\f14a";font-weight:400}#swipe-action>div>span.deselect::before{content:"\f0c8";font-weight:400}#swipe-action>div>span.archive::before{content:"\f187"}#swipe-action>div>span.junk::before{content:"\f06d"}.swipe-active,.swipe-active>td{background-color:#fff}#messagelist.swipe-active{height:100%}#messagelist.swipe-active.swipe-block{display:block} \ No newline at end of file diff --git a/swipe.js b/swipe.js index e32caaf..cf7dc50 100644 --- a/swipe.js +++ b/swipe.js @@ -259,6 +259,10 @@ rcube_webmail.prototype.swipe_event = function(opts) { if (opts.parent_obj) opts.parent_obj.off(touchevents.moveevent, rcube_event.cancel); + + // set display block to make table height work on android + if ($.isEmptyObject(rcmail.message_list.rows)) + $(rcmail.gui_objects.messagelist).addClass('swipe-block'); } }) .on(touchevents.moveevent, function(e) { @@ -363,7 +367,7 @@ rcube_webmail.prototype.swipe_event = function(opts) { callback({'uid': opts[touchstart.axis].uid, 'obj': opts[touchstart.axis].target_obj, 'originalEvent': e}); $('#swipe-action').removeClass().hide(); - opts[touchstart.axis].target_obj.removeClass('swipe-active'); + opts[touchstart.axis].target_obj.removeClass('swipe-active swipe-block'); touchstart = {}; rcmail.env.swipe_active = null;