Sha256: 9ce5dae9e0d4839ef756b1fb6e5185d1209c76196c77053fa94a55e34a060fb8

Contents?: true

Size: 1.15 KB

Versions: 1

Compression:

Stored size: 1.15 KB

Contents

require "rubygems"
require "bundler/setup"

require 'ruby-event'

module RubyApp
  
  module Elements
    require 'rubyapp/element'
  
    class Page < RubyApp::Element
      
      class LoadedEvent < RubyApp::Element::Event
        
        def initialize(data)
          super(data)
        end
        
      end
      
      template_path(__FILE__)
      
      def initialize
        super
        
        require 'rubyapp/elements/navigation/breadcrumbs'

        @breadcrumbs = RubyApp::Elements::Navigation::Breadcrumbs.new
        
        require 'rubyapp/elements/link'

        @reload = RubyApp::Elements::Link.new
        @reload.clicked do |element, event|
          self.class.reload_locale!
          event.refresh
        end

        @quit = RubyApp::Elements::Link.new
        @quit.clicked do |element, event|
          RubyApp::Session.current.quit
          event.refresh
        end
        
      end
      
      protected
      
        def on_event(event)
          super(event)
          on_loaded(event) if event.is_a?(RubyApp::Elements::Page::LoadedEvent)
        end
        
        def on_loaded(event)
        end
  
    end

  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
_rubyapp-0.0.3 lib/rubyapp/elements/page.rb