module Magic::Toolbar

Public Class Methods

included(base) click to toggle source
# File lib/extmodules/magic.rb, line 175
def self.included(base)
  base.class_eval do

    before_to_extjs :arrage_toolbar

    define_method :arrage_toolbar do |at_deep|
      if @childs.last.xtype == "toolbar"
        @config.merge! :fbar => @childs.last.to_extjs(at_deep + 1)
        @childs.pop
      end

      if @childs.first.xtype == "toolbar"
        @config.merge! :tbar => @childs.first.to_extjs(at_deep + 1)
        @childs.slice!(0)
      end 
    end
  end
end