Browse Source

Moves down the RTE toolbar when it's closer to the top canvas edge. Fixes #61

pull/236/merge
Artur Arseniev 9 years ago
parent
commit
637811d5d3
  1. 2
      index.html
  2. 9
      src/rich_text_editor/index.js

2
index.html

@ -13,7 +13,7 @@
</style>
<body>
<div id="gjs" style="height:0px; overflow:hidden;">
<div>Some TEXT</div>
<div style="float:right; width: 100px;">Test text</div>
<header class="header-banner">
<div class="container-width">
<div class="logo-container">

9
src/rich_text_editor/index.js

@ -122,7 +122,14 @@ module.exports = () => {
var pos = canvas.getTargetToElementDim(toolbar.el, this.lastEl, {
event: 'rteToolbarPosUpdate',
});
console.log(pos);
if (c.adjustToolbar) {
// Move the toolbar down when the top canvas edge is reached
if (pos.top <= pos.canvasTop) {
pos.top = pos.elementTop + pos.elementHeight;
}
}
var toolbarStyle = toolbar.el.style;
toolbarStyle.top = pos.top + u;
toolbarStyle.left = pos.left + u;

Loading…
Cancel
Save