Skip to content

Commit

Permalink
Generates new CSS file, changes variable name to camelCase
Browse files Browse the repository at this point in the history
  • Loading branch information
daviferreira committed Sep 30, 2013
1 parent 84d1ba5 commit 65bba99
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dist/css/medium.editor.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions dist/js/medium.editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,19 @@ function MediumEditor(elements, options) {
},

setToolbarPosition: function () {
var selection = window.getSelection(),
var buttonHeight = 50,
selection = window.getSelection(),
range = selection.getRangeAt(0),
boundary = range.getBoundingClientRect();
this.toolbar.style.top = boundary.top + this.options.diffTop + window.pageYOffset - this.toolbar.offsetHeight + 'px';
if (boundary.top < buttonHeight) {
this.toolbar.classList.add('medium-toolbar-arrow-over');
this.toolbar.classList.remove('medium-toolbar-arrow-under');
this.toolbar.style.top = buttonHeight + boundary.bottom - this.options.diffTop + window.pageYOffset - this.toolbar.offsetHeight + 'px';
} else {
this.toolbar.classList.add('medium-toolbar-arrow-under');
this.toolbar.classList.remove('medium-toolbar-arrow-over');
this.toolbar.style.top = boundary.top + this.options.diffTop + window.pageYOffset - this.toolbar.offsetHeight + 'px';
}
this.toolbar.style.left = ((boundary.left + boundary.right) / 2) - (this.toolbar.offsetWidth / 2) + (this.options.diffLeft) + 'px';
return this;
},
Expand Down
Loading

0 comments on commit 65bba99

Please sign in to comment.