Sha256: bb0f1bdb066b334c2afe51e7bcd6dd856b3aca23e3b81d33d0605aea4bef34a0

Contents?: true

Size: 799 Bytes

Versions: 3

Compression:

Stored size: 799 Bytes

Contents

class SomeTabPanel < Netzke::Workspace::TabPanel
  action :new_tab
  action :current_tab
  action :close_all

  js_configure do |c|
    c.on_new_tab = <<-JS
      function() {
        this.index = this.index || 0;
        this.index++;
        this.loadTab("HelloUser", {clientConfig: {user: "User "+this.index}, newTab: true});
      }
    JS

    c.on_current_tab = <<-JS
      function() {
        this.index = this.index || 0;
        this.index++;
        this.loadTab("HelloUser", {clientConfig: {user: "User "+this.index}});
      }
    JS

    c.on_close_all = <<-JS
      function() { this.closeAllTabs(); }
    JS
  end

  component :tab do |c|
    super c
    c.user = c.client_config[:user]
  end

  def configure(c)
    super
    c.bbar = [:new_tab, :current_tab, :close_all]
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
netzke-workspace-0.10.2 spec/rails_app/app/components/some_tab_panel.rb
netzke-workspace-0.10.1 spec/rails_app/app/components/some_tab_panel.rb
netzke-workspace-0.10.0 spec/rails_app/app/components/some_tab_panel.rb