Sha256: c179d3d601c860b5b2577c466f58bb11cd9efcb653f3030b5c58770293a56e6b

Contents?: true

Size: 934 Bytes

Versions: 1

Compression:

Stored size: 934 Bytes

Contents

require 'rails/railtie'
require 'mozaic'

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.1 lib/turbolinks-animate/railtie.rb