Skip to content

Commit 816a5db

Browse files
committed
the link popover attached to the RTE was not working + fix an error if the RTE takes a long time to be fully loaded
1 parent 305fd46 commit 816a5db

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

app/assets/javascripts/locomotive/views/inputs/rte/link_view.js.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Locomotive.Views.Inputs.Rte.LinkView extends Backbone.View
2525
create_popover: ->
2626
@$content.show()
2727
@$link.popover
28-
container: '.editable-elements'
28+
container: @$link.parents('fieldset')
2929
placement: 'right'
3030
content: @$content
3131
html: true

app/assets/javascripts/locomotive/views/inputs/rte/table_view.js.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Locomotive.Views.Inputs.Rte.TableView extends Backbone.View
2323
create_popover: ->
2424
@$content.show()
2525
@$link.popover
26-
container: '.editable-elements'
26+
container: @$link.parents('fieldset')
2727
placement: 'right'
2828
content: @$content
2929
html: true

app/assets/javascripts/locomotive/views/inputs/rte_view.js.coffee.erb

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,15 @@ class Locomotive.Views.Inputs.RteView extends Backbone.View
3333
@editor.on 'load', @register_editor_events
3434

3535
render_views: ->
36-
that = @
37-
setTimeout(
38-
->
39-
that.views = [
40-
that.build_and_render_view(Locomotive.Views.Inputs.Rte.LinkView),
41-
that.build_and_render_view(Locomotive.Views.Inputs.Rte.FileView),
42-
that.build_and_render_view(Locomotive.Views.Inputs.Rte.ImageView),
43-
that.build_and_render_view(Locomotive.Views.Inputs.Rte.TableView),
44-
that.build_and_render_view(Locomotive.Views.Inputs.Rte.EditTableView)
45-
]
46-
, 200)
36+
@editor.on 'load', =>
37+
@views = [
38+
@build_and_render_view(Locomotive.Views.Inputs.Rte.LinkView),
39+
@build_and_render_view(Locomotive.Views.Inputs.Rte.FileView),
40+
@build_and_render_view(Locomotive.Views.Inputs.Rte.ImageView),
41+
@build_and_render_view(Locomotive.Views.Inputs.Rte.TableView),
42+
@build_and_render_view(Locomotive.Views.Inputs.Rte.EditTableView)
43+
]
44+
console.log '[RTE] all views created and rendered'
4745

4846
expand: (event) ->
4947
event.stopPropagation() & event.preventDefault()
@@ -91,7 +89,6 @@ class Locomotive.Views.Inputs.RteView extends Backbone.View
9189
@editor.on 'aftercommand:composer', @on_content_change
9290

9391
on_content_change: ->
94-
console.log 'modified'
9592
PubSub.publish 'inputs.text_changed',
9693
view: @
9794
content: @editor.getValue()

0 commit comments

Comments
 (0)