mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 16:06:16 -04:00
Merge pull request #2298 from ether/reflow-toolbar-properly
Reflow toolbar properly
This commit is contained in:
commit
8d2fa35b3f
3 changed files with 50 additions and 15 deletions
|
@ -937,4 +937,3 @@ exports.handshake = handshake;
|
|||
exports.pad = pad;
|
||||
exports.init = init;
|
||||
exports.alertBar = alertBar;
|
||||
|
||||
|
|
|
@ -140,7 +140,12 @@ var padeditbar = (function()
|
|||
init: function() {
|
||||
var self = this;
|
||||
self.dropdowns = [];
|
||||
|
||||
// Listen for resize events (sucks but needed as iFrame ace_inner has to be position absolute
|
||||
// A CSS fix for this would be nice but I'm not sure how we'd do it.
|
||||
$(window).resize(function(){
|
||||
self.redrawHeight();
|
||||
});
|
||||
|
||||
$("#editbar .editbarbutton").attr("unselectable", "on"); // for IE
|
||||
$("#editbar").removeClass("disabledtoolbar").addClass("enabledtoolbar");
|
||||
$("#editbar [data-key]").each(function () {
|
||||
|
@ -149,6 +154,10 @@ var padeditbar = (function()
|
|||
});
|
||||
});
|
||||
|
||||
$('#editbar').show();
|
||||
|
||||
this.redrawHeight();
|
||||
|
||||
registerDefaultCommands(self);
|
||||
|
||||
hooks.callAll("postToolbarInit", {
|
||||
|
@ -170,6 +179,12 @@ var padeditbar = (function()
|
|||
this.commands[cmd] = callback;
|
||||
return this;
|
||||
},
|
||||
redrawHeight: function(){
|
||||
var editbarHeight = $('.menu_left').height() + 2 + "px";
|
||||
var containerTop = $('.menu_left').height() + 5 + "px";
|
||||
$('#editbar').css("height", editbarHeight);
|
||||
$('#editorcontainer').css("top", containerTop);
|
||||
},
|
||||
registerDropdownCommand: function (cmd, dropdown) {
|
||||
dropdown = dropdown || cmd;
|
||||
self.dropdowns.push(dropdown)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue