Sha256: 577e10f55025fe714d9d4122161f4df4f3a6e10c286f7c0a416599770c998c99

Contents?: true

Size: 795 Bytes

Versions: 19

Compression:

Stored size: 795 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
      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

19 entries across 19 versions & 1 rubygems

Version Path
locomotivecms-4.0.0.alpha3 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-3.4.1 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-4.0.0.alpha2 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-4.0.0.alpha1 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-3.4.0 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-3.3.0 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-3.3.0.rc3 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-3.3.0.rc2 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-3.1.2 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-3.2.1 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-3.3.0.rc1 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-3.2.0 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-3.2.0.rc2 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-3.2.0.rc1 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-3.1.1 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-3.1.0 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-3.1.0.rc3 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-3.1.0.rc2 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee
locomotivecms-3.1.0.rc1 app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee