Skip to content

Commit

Permalink
Document routing
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Gorin committed Dec 28, 2015
1 parent 68bff75 commit 31aceee
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
12 changes: 6 additions & 6 deletions javascripts/base.js
Expand Up @@ -387,7 +387,7 @@ Ext.define("Netzke.Base", {
* Dynamically loads child Netzke component
* @method netzkeLoadComponent
* @param {String} name Component name as declared in the Ruby class with `component` DSL
* @param {Object} [params] May contain the following optional keys:
* @param {Object} [options] May contain the following optional keys:
* * **container** {Ext.container.Container|Integer}
*
* The instance (or id) of a container with the "fit" layout where the loaded component will be added to; the previously existing component will be destroyed
Expand Down Expand Up @@ -438,12 +438,12 @@ Ext.define("Netzke.Base", {
* serverConfig: { user: 'bill' } // on the server: client_config[:user] == 'bill'
* });
*/
netzkeLoadComponent: function(name, params){
netzkeLoadComponent: function(name, options){
var container, serverParams, containerEl;
params = params || {};
options = options || {};

container = this.netzkeChooseContainer(params);
serverParams = this.netzkeBuildServerLoadingParams(name, params);
container = this.netzkeChooseContainer(options);
serverParams = this.netzkeBuildServerLoadingParams(name, options);

this.netzkeShowLoadingMask(container);

Expand All @@ -452,7 +452,7 @@ Ext.define("Netzke.Base", {
this.netzkeHideLoadingMask(container);

if (success) {
this.netzkeHandleLoadingResponse(container, result, params);
this.netzkeHandleLoadingResponse(container, result, options);
} else {
this.netzkeHandleLoadingError(result);
}
Expand Down
17 changes: 16 additions & 1 deletion javascripts/routing.js
@@ -1,4 +1,8 @@
Ext.define(null, {
/**
* Routing override for Netzke.Base.
* @class Netzke.Core.Routing
*/
Ext.define('Netzke.Core.Routing', {
override: 'Netzke.Base',

netzkeAfterInitComponent: function(){
Expand All @@ -15,6 +19,17 @@ Ext.define(null, {
this.callParent();
},

/**
* Navigate to new hash route.
* @method netzkeNavigateTo
* @param route {String} Route
* @param {Object} [options] Options:
* * **append** {Boolean} append to the current route
*
* @example
*
* this.netzkeNavigateTo('user/1', {append: true})
*/
netzkeNavigateTo: function(route, options){
options = options || {};
var newRoute = route;
Expand Down

0 comments on commit 31aceee

Please sign in to comment.