Sha256: c2e99135ae8184b629d6b51024223e1054a6f9773498e9b62d6b4d6983533a5d

Contents?: true

Size: 944 Bytes

Versions: 1

Compression:

Stored size: 944 Bytes

Contents

require 'rails/railtie'

module TurbolinksAnimate
    class Railtie < Rails::Railtie

        initializer 'turbolinks-animate.mozaic' do
            Mozaic.configure do |config|
                config.define_component 'turbolinks-animate', element: 'body' do |options|
                    animation = options.delete :animation
                    if animation
                        options[:class] += ( options[:class].length > 0 ? ' turbolinks-animate' : 'turbolinks-animate' )
                        options[:data] ||= {}
                        options[:data][:turbolinks_animate_animation] = animation
                    end
                    options
                end
            end
        end

        initializer 'turbolinks-animate.action_controller' do
            ActiveSupport.on_load :action_controller do
                include TurbolinksAnimateHelper
            end
        end

    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
turbolinks-animate-2.0.0 lib/turbolinks-animate/railtie.rb