Merge pull request #2721 from lpagliari/develop

Complementing #2718 + Fixing empty toolbar when on read-only & menu_left has no button
pull/2735/head
Peter 'Pita' Martischka 2015-07-17 21:07:41 +01:00
commit 31452b2db2
2 changed files with 28 additions and 2 deletions

View File

@ -216,6 +216,10 @@ li[data-key=showusers] > a #online_count {
right: 0px; right: 0px;
bottom: 0px; bottom: 0px;
z-index: 1; z-index: 1;
/* Required to fix toolbar on top/bottom of the screen on iOS: */
overflow: scroll;
-webkit-overflow-scrolling: touch;
} }
#editorcontainer iframe { #editorcontainer iframe {
height: 100%; height: 100%;

View File

@ -185,9 +185,31 @@ var padeditbar = (function()
this.commands[cmd] = callback; this.commands[cmd] = callback;
return this; 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(){ redrawHeight: function(){
var editbarHeight = $('.menu_left').height() + 1 + "px"; var minimunEditbarHeight = self.calculateEditbarHeight();
var containerTop = $('.menu_left').height() + 6 + "px"; var editbarHeight = minimunEditbarHeight + 1 + "px";
var containerTop = minimunEditbarHeight + 6 + "px";
$('#editbar').css("height", editbarHeight); $('#editbar').css("height", editbarHeight);
$('#editorcontainer').css("top", containerTop); $('#editorcontainer').css("top", containerTop);