Sha256: 390671f83aea917eef5d5df6f508512a48bcda3b7935d95bf8735b837f11017a
Contents?: true
Size: 1.17 KB
Versions: 85
Compression:
Stored size: 1.17 KB
Contents
# This initializes all the effective_* form inputs also in this gem this.EffectiveBootstrap ||= new class initialize: (target) -> $(target || document).find('[data-input-js-options]:not(.initialized)').each (i, element) -> $element = $(element) options = $element.data('input-js-options') return true unless (options['method_name'] || '').length > 0 method_name = options['method_name'] delete options['method_name'] unless EffectiveBootstrap[method_name] return console.error("EffectiveBootstrap #{method_name} has not been implemented") EffectiveBootstrap[method_name].call(this, $element, options) $element.addClass('initialized') $ -> EffectiveBootstrap.initialize() $(document).on 'turbolinks:load', -> EffectiveBootstrap.initialize() $(document).on 'cocoon:after-insert', -> EffectiveBootstrap.initialize() $(document).on 'effective-bootstrap:initialize', (event) -> EffectiveBootstrap.initialize(event.currentTarget) $(document).on 'effective-bootstrap:reinitialize', (event) -> $(event.currentTarget).find('[data-input-js-options].initialized').removeClass('initialized') EffectiveBootstrap.initialize(event.currentTarget)
Version data entries
85 entries across 85 versions & 1 rubygems