From 8a0a1a65b1e9594e5e3bee2a73c7690c0589a008 Mon Sep 17 00:00:00 2001 From: Luiza Pagliari Date: Tue, 7 Jul 2015 15:20:18 -0300 Subject: [PATCH 1/2] Adding missing code to make toolbar be fixed on top/bottom of the screen for iOS devices. This commit complements 9ccaeb5. --- src/static/css/pad.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/static/css/pad.css b/src/static/css/pad.css index d21e84dd..1e43ab96 100644 --- a/src/static/css/pad.css +++ b/src/static/css/pad.css @@ -216,6 +216,10 @@ li[data-key=showusers] > a #online_count { right: 0px; bottom: 0px; z-index: 1; + + /* Required to fix toolbar on top/bottom of the screen on iOS: */ + overflow: scroll; + -webkit-overflow-scrolling: touch; } #editorcontainer iframe { height: 100%; From 67f4ad5887a6a7b6c8b5645331298accb30297cb Mon Sep 17 00:00:00 2001 From: Luiza Pagliari Date: Tue, 7 Jul 2015 16:55:19 -0300 Subject: [PATCH 2/2] Fix editbar height for read-only pads --- src/static/js/pad_editbar.js | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/static/js/pad_editbar.js b/src/static/js/pad_editbar.js index e418969e..48fcaab4 100644 --- a/src/static/js/pad_editbar.js +++ b/src/static/js/pad_editbar.js @@ -185,9 +185,31 @@ var padeditbar = (function() this.commands[cmd] = callback; return this; }, + calculateEditbarHeight: function() { + // if we're on timeslider, there is nothing on editbar, so we just use zero + var onTimeslider = $('.menu_left').length === 0; + if (onTimeslider) return 0; + + // if editbar has both menu left and right, its height must be + // the max between the height of these two parts + var leftMenuPosition = $('.menu_left').offset().top; + var rightMenuPosition = $('.menu_right').offset().top; + var editbarHasMenuLeftAndRight = (leftMenuPosition === rightMenuPosition); + + var height; + if (editbarHasMenuLeftAndRight) { + height = Math.max($('.menu_left').height(), $('.menu_right').height()); + } + else { + height = $('.menu_left').height(); + } + + return height; + }, redrawHeight: function(){ - var editbarHeight = $('.menu_left').height() + 1 + "px"; - var containerTop = $('.menu_left').height() + 6 + "px"; + var minimunEditbarHeight = self.calculateEditbarHeight(); + var editbarHeight = minimunEditbarHeight + 1 + "px"; + var containerTop = minimunEditbarHeight + 6 + "px"; $('#editbar').css("height", editbarHeight); $('#editorcontainer').css("top", containerTop);