Sha256: 131bafda71e6641d897c7cd101a9a20106d726acbe97e0bd80f2434512c53974

Contents?: true

Size: 1.71 KB

Versions: 6

Compression:

Stored size: 1.71 KB

Contents

{
  initComponent: function(){
    this.callParent();

    this.mainPanel = this.down('panel[itemId="main_panel"]');
    this.menuBar   = this.down('container[itemId="menu_bar"]');
    var statusBar = this.statusBar = this.down('container[itemId="status_bar"]');

    Ext.util.History.on('change', this.processHistory, this);

    // Setting the "busy" indicator for Ajax requests
    Ext.Ajax.on('beforerequest',    function(){ statusBar.showBusy(); });
    Ext.Ajax.on('requestcomplete',  function(){ statusBar.hideBusy(); });
    Ext.Ajax.on('requestexception', function(){ statusBar.hideBusy(); });

    // Initialize history
    Ext.util.History.init();
  },

  afterRender: function(){
    this.callParent();

    // If we are given a token, load the corresponding component, otherwise load the last loaded component
    var currentToken = Ext.util.History.getToken();
    if (currentToken != "") {
      this.processHistory(currentToken);
    } else {
      var lastLoaded = this.initialConfig.componentToLoad; // passed from the server
      if (lastLoaded) Ext.util.History.add(lastLoaded);
    }
  },

  processHistory: function(token){
    if (token){
      this.mainPanel.removeAll();
      this.netzkeLoadComponent(token, {container: this.mainPanel});
    } else {
      this.mainPanel.removeAll();
    }
  },

  // instantiateComponent: function(config){
  //   this.mainPanel.instantiateChild(config);
  // },

  appLoadComponent: function(name){
    Ext.util.History.add(name);
  },

  netzkeLoadComponentByAction: function(action){
    var componentName = action.component || action.name;
    if (componentName) this.appLoadComponent(componentName);
  },

  onToggleConfigMode: function(params){
    this.toggleConfigMode();
  }
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
netzke-basepack-0.9.0.rc1 lib/netzke/basepack/simple_app/javascripts/simple_app.js
netzke-basepack-0.8.4 lib/netzke/basepack/simple_app/javascripts/simple_app.js
netzke-basepack-0.8.3 lib/netzke/basepack/simple_app/javascripts/simple_app.js
netzke-basepack-0.8.2 lib/netzke/basepack/simple_app/javascripts/simple_app.js
netzke-basepack-0.8.1 lib/netzke/basepack/simple_app/javascripts/simple_app.js
netzke-basepack-0.8.0 lib/netzke/basepack/simple_app/javascripts/simple_app.js