Sha256: c77c258607f8ff70a7ca5d2bfccf560932a5c5e98bb7e0f8385b6f99e2ae467f

Contents?: true

Size: 1.08 KB

Versions: 3

Compression:

Stored size: 1.08 KB

Contents

# Tabs

enable_redactor = ->
  # Workaround for redactor and easytabs integration,
  # the problem is that not current redactors are not
  # clickable after init.
  
  window.redactor_settings =
    buttons: ['html', '|',
              'formatting', '|',
              'bold', 'italic', 'deleted', '|',
              'unorderedlist', 'orderedlist', 'outdent', 'indent', '|',
              'image', 'video', 'file', 'table', 'link', '|',
              'alignleft', 'aligncenter', 'alignright', 'justify', '|',
              'fullscreen' ]

  # after tab was clicked there is a workaround to turn on redactor
  $('#settings_tabs').bind 'easytabs:after', (event, $clicked, $targetPanel, settings) ->
    text_input = $targetPanel.find('.settings-redactor')
    if text_input.css("display") != "none"
      text_input.redactor window.redactor_settings

  # init redactor for the first visible tab
  $('#settings_tabs .settings-redactor:visible').redactor window.redactor_settings

$ ->
  $('#settings_tabs').easytabs
    animate:true
    animationSpeed:0
    tabActiveClass:"selected"

  enable_redactor()

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
activeadmin-settings-0.2.9 vendor/assets/javascripts/activeadmin_settings/tabs.js.coffee
activeadmin-settings-0.2.8 vendor/assets/javascripts/activeadmin_settings/tabs.js.coffee
activeadmin-settings-0.2.7 vendor/assets/javascripts/activeadmin_settings/tabs.js.coffee