Sha256: 3ce57489b7a4077fc795ff9f40fedda75785829380378ac5cdd964b383f56022

Contents?: true

Size: 699 Bytes

Versions: 1

Compression:

Stored size: 699 Bytes

Contents

(function () {
  'use strict'

  // --- functions -------------------------------------------------------------
  function initMediumEditors() {
    $('[data-aa-medium-editor]').each(function () {
      if (!$(this).hasClass('medium-editor--active')) {
        let options = {}
        options = $.extend({}, options, $(this).data('options'))
        new MediumEditor($(this), options)
        $(this).addClass('medium-editor--active')
      }
    })
  }

  // --- events ----------------------------------------------------------------
  $(document).ready(() => {
    initMediumEditors()
  })

  $(document).on('has_many_add:after', '.has_many_container', () => {
    initMediumEditors()
  })
})()

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activeadmin_medium_editor-0.2.12 app/assets/javascripts/activeadmin/medium_editor_input.js