1
0
mirror of https://github.com/flarum/core.git synced 2025-07-30 21:20:24 +02:00

Tweak quote button positioning/style

Now appears where your cursor ends the selection, but not overlapping text.
This commit is contained in:
Toby Zerner
2016-05-22 14:05:38 +09:30
parent a05600b91e
commit 310fed2329
4 changed files with 42 additions and 13 deletions

View File

@@ -26,12 +26,20 @@ export default class PostQuoteButton extends Button {
$(document).on('mousedown', this.hide.bind(this));
}
show(left, top) {
showStart(left, top) {
const $this = this.$();
$this.show()
.css('top', top - $this.outerHeight() - 5)
.css('left', left);
.css('left', left)
.css('top', $(window).scrollTop() + top - $this.outerHeight() - 5);
}
showEnd(right, bottom) {
const $this = this.$();
$this.show()
.css('left', right - $this.outerWidth())
.css('top', $(window).scrollTop() + bottom + 5)
}
hide() {