summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McLear <john@mclear.co.uk>2014-11-06 15:43:21 +0000
committerJohn McLear <john@mclear.co.uk>2014-11-06 15:43:21 +0000
commit0685e563ed947a42377fe1a5eb6fca10f3e8e833 (patch)
treea02be20684e1038312a9ac2d3189e726fcb9e2ee
parent96d6e7c1b7df59e96c394608a343cb698c848576 (diff)
downloadetherpad-lite-0685e563ed947a42377fe1a5eb6fca10f3e8e833.zip
working on resize
-rw-r--r--src/static/css/pad.css1
-rw-r--r--src/static/js/pad.js13
-rw-r--r--src/static/js/pad_editbar.js15
3 files changed, 15 insertions, 14 deletions
diff --git a/src/static/css/pad.css b/src/static/css/pad.css
index 228c035f..11705e06 100644
--- a/src/static/css/pad.css
+++ b/src/static/css/pad.css
@@ -933,6 +933,7 @@ input[type=checkbox] {
margin-bottom: 33px
}
.toolbar ul.menu_left {
+ right:0px;
}
.toolbar ul.menu_right {
background: #f7f7f7;
diff --git a/src/static/js/pad.js b/src/static/js/pad.js
index 6a3a2e0e..649d8c82 100644
--- a/src/static/js/pad.js
+++ b/src/static/js/pad.js
@@ -370,19 +370,6 @@ function handshake()
$('#readonlyinput').on('click',function(){
padeditbar.setEmbedLinks();
});
- // 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(){
- redrawEditbar();
- });
- redrawEditbar();
-}
-
-var redrawEditbar = function(){
- var editbarHeight = $('.menu_left').height() + 2 + "px";
- var containerTop = $('.menu_left').height() + 5 + "px";
- $('#editbar').css("height", editbarHeight);
- $('#editorcontainer').css("top", containerTop);
}
$.extend($.gritter.options, {
diff --git a/src/static/js/pad_editbar.js b/src/static/js/pad_editbar.js
index 6352b129..c067bbba 100644
--- a/src/static/js/pad_editbar.js
+++ b/src/static/js/pad_editbar.js
@@ -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,8 @@ var padeditbar = (function()
});
});
+ this.redrawHeight();
+
registerDefaultCommands(self);
hooks.callAll("postToolbarInit", {
@@ -170,6 +177,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)