Skip to content

Commit a32c570

Browse files
committed
append popovers to simditor el instead of wrapper
1 parent 8da1f47 commit a32c570

File tree

5 files changed

+28
-28
lines changed

5 files changed

+28
-28
lines changed

lib/simditor-all.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/simditor.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/assets/scripts/simditor-all.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/buttons/popover.coffee

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Popover extends Module
1111

1212
constructor: (@editor) ->
1313
@el = $('<div class="simditor-popover"></div>')
14-
.appendTo(@editor.wrapper)
14+
.appendTo(@editor.el)
1515
.data('popover', @)
1616
@render()
1717

@@ -56,16 +56,16 @@ class Popover extends Module
5656

5757
refresh: (position = 'bottom') ->
5858
return unless @active
59-
wrapperOffset = @editor.wrapper.offset()
59+
editorOffset = @editor.el.offset()
6060
targetOffset = @target.offset()
6161
targetH = @target.outerHeight()
6262

6363
if position is 'bottom'
64-
top = targetOffset.top - wrapperOffset.top + targetH
64+
top = targetOffset.top - editorOffset.top + targetH
6565
else if position is 'top'
66-
top = targetOffset.top - wrapperOffset.top - @el.height()
66+
top = targetOffset.top - editorOffset.top - @el.height()
6767

68-
left = Math.min(targetOffset.left - wrapperOffset.left, @editor.wrapper.width() - @el.outerWidth() - 10)
68+
left = Math.min(targetOffset.left - editorOffset.left, @editor.wrapper.width() - @el.outerWidth() - 10)
6969

7070
@el.css({
7171
top: top + @offset.top,

src/simditor.coffee

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1956,7 +1956,7 @@ class Popover extends Module
19561956

19571957
constructor: (@editor) ->
19581958
@el = $('<div class="simditor-popover"></div>')
1959-
.appendTo(@editor.wrapper)
1959+
.appendTo(@editor.el)
19601960
.data('popover', @)
19611961
@render()
19621962

@@ -2001,16 +2001,16 @@ class Popover extends Module
20012001

20022002
refresh: (position = 'bottom') ->
20032003
return unless @active
2004-
wrapperOffset = @editor.wrapper.offset()
2004+
editorOffset = @editor.el.offset()
20052005
targetOffset = @target.offset()
20062006
targetH = @target.outerHeight()
20072007

20082008
if position is 'bottom'
2009-
top = targetOffset.top - wrapperOffset.top + targetH
2009+
top = targetOffset.top - editorOffset.top + targetH
20102010
else if position is 'top'
2011-
top = targetOffset.top - wrapperOffset.top - @el.height()
2011+
top = targetOffset.top - editorOffset.top - @el.height()
20122012

2013-
left = Math.min(targetOffset.left - wrapperOffset.left, @editor.wrapper.width() - @el.outerWidth() - 10)
2013+
left = Math.min(targetOffset.left - editorOffset.left, @editor.wrapper.width() - @el.outerWidth() - 10)
20142014

20152015
@el.css({
20162016
top: top + @offset.top,

0 commit comments

Comments
 (0)