Sha256: 264fb9ce0070f837bb27cff47d4830ab597546a656604a19966fef74dd5e5e02

Contents?: true

Size: 819 Bytes

Versions: 10

Compression:

Stored size: 819 Bytes

Contents

Locomotive.Views.Inputs.Rte ||= {}

class Locomotive.Views.Inputs.Rte.EditTableView extends Backbone.View

  initialize: ->
    _.bindAll(@, 'hide')

    @$link    = @$('a[data-wysihtml5-hiddentools=table]')
    @$content = @$link.next('.table-dialog-content')
    @editor   = @options.editor

  render: ->
    return if @$link.size() == 0

    @create_popover()
    @attach_events()

  create_popover: ->
    @$link.popover
      placement:  'bottom'
      content:    @$content.html()
      html:       true
      sanitize:   false
      title:      undefined

  attach_events: ->
    @editor.on 'tableunselect:composer', @hide

  detach_events: ->
    @editor.stopObserving 'tableselect:composer', @hide

  hide: ->
    @$link.popover('hide')

  remove: ->
    @$link.popover('destroy')
    @$('.popover').remove()

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
locomotivecms-4.2.0.alpha2 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-4.2.0.alpha1 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-4.1.1 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-4.1.0 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-4.1.0.rc1 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-4.0.3 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-4.0.2 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-4.0.1 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-4.0.0 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-4.0.0.rc0 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee