Skip to content
This repository has been archived by the owner on Jul 15, 2019. It is now read-only.

Commit

Permalink
Modify Config example
Browse files Browse the repository at this point in the history
  • Loading branch information
gzip committed Apr 26, 2012
1 parent da35ebc commit ce5df1b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
5 changes: 3 additions & 2 deletions mojits/Config/binders/index.js
Expand Up @@ -2,9 +2,10 @@ YUI.add('ConfigBinder', function(Y, NAME)
{
Y.namespace('mojito.binders')[NAME] =
{
init: function(proxy)
init: function(proxy)
{
var self = this;
Y.log(proxy.context, 'warn');
Y.log(proxy.config, 'warn');
}
};
}, '0.0.1', {requires: ['mojito-client']});
15 changes: 10 additions & 5 deletions mojits/Config/controller.common.js
Expand Up @@ -9,11 +9,16 @@ YUI.add('mojit', function(Y, NAME)

index: function(ac)
{
ac.done(
Y.merge(ac.context, {
config: Y.JSON.stringify(this.config)
})
);
var self = this,
json = Y.JSON.stringify;

self.config.foo = 'foo';

ac.done({
context: json(ac.context),
config: json(self.config),
yui: json(ac.app.config.yui)
});
}
};
}, '0.0.1', {requires: ['json', 'mojito']});
9 changes: 5 additions & 4 deletions mojits/Config/views/index.mu.html
@@ -1,10 +1,11 @@
<style>dt { font-weight: bold; }</style>
<div id="{{mojit_view_id}}">
<dl>
<dt>context</dt>
<dd>{{context}}</dd>
<dt>config</dt>
<dd>{{config}}</dd>
<dt>lang</dt>
<dd>{{lang}}</dd>
<dt>device</dt>
<dd>{{device}}</dd>
<dt>yui</dt>
<dd>{{yui}}</dd>
</dl>
</div>

0 comments on commit ce5df1b

Please sign in to comment.