Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
Merge pull request #1315 from lzhan/next
Browse files Browse the repository at this point in the history
Add this fix to next branch: Fix issue #1306: ac.partial.render() throws error for handlebar custom helper
  • Loading branch information
lzhan committed Jan 24, 2014
2 parents ca7f195 + 9693614 commit eddaf42
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 14 deletions.
9 changes: 8 additions & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@ Features
Bug Fixes
---------

* Issue #1280: Composite.execute cannot be called multiple times in the same mojit
* Issue #1306: ac.partial.render() throws error for handlebar custom helper

Acknowledgements
----------------

version 0.8.2
=================

Bug Fixes
---------

* Issue #1280: Composite.execute cannot be called multiple times in the same mojit

version 0.8.1
=================
Expand Down
2 changes: 1 addition & 1 deletion lib/app/addons/ac/partial.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ YUI.add('mojito-partial-addon', function (Y, NAME) {

id = NAME + '::' + (instance.id || '@' + instance.type) + '>render:' + view;

renderer.render(data, instance.type, mojitView, new Y.mojito.OutputBuffer(id, cb), meta);
renderer.render(data, instance, mojitView, new Y.mojito.OutputBuffer(id, cb), meta);
},

/**
Expand Down
8 changes: 4 additions & 4 deletions lib/app/autoload/store.server.js
Original file line number Diff line number Diff line change
Expand Up @@ -743,11 +743,11 @@ YUI.add('mojito-resource-store', function(Y, NAME) {
if (res.name.indexOf('partials/') === 0) {
// removing the "partials/" prefix
details.partials[this._libs.path.basename(res.name)] = template;
} else {
details.views[res.name] = template;
details.views[res.name].assets = res.view.assets;
details.views[res.name].engine = res.view.engine;
}
details.views[res.name] = template;
details.views[res.name].assets = res.view.assets;
details.views[res.name].engine = res.view.engine;

continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ YUI.add('ActionContextMojit', function(Y, NAME) {
}else if(test=="done8"){
ac.done({data:"Hello, world!--from done"}, {view: {name: "mytemplate"}});
}else if(test=="done9"){
ac.done({ foo: null }, {view: {name: "mytemplate1"}});
ac.done({ foo: null }, {view: {name: "testdir/mytemplate1"}});
}else if(test=="done10"){
ac.done({ foo: [ 1, 2, null, 4 ]}, {view: {name: "mytemplate1"}} );
ac.done({ foo: [ 1, 2, null, 4 ]}, {view: {name: "testdir/mytemplate1"}} );
}else if(test=="flush8"){
ac.flush({data:"Hello, world!--from flush"}, {view: {name: "mytemplate"}});
ac.done();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ YUI.add('PartialMojit', function(Y, NAME) {
ac.done(mymarkup);
});*/
//ac.done(data);
ac.partial.render(data, "sub", function(error, mymarkup){
ac.partial.render(data, "partials/sub", function(error, mymarkup){
Y.log("HereController....."+mymarkup);
ac.done(mymarkup);
})
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div id="{{mojit_view_id}}" class="sub">
<label id="subdata">From partials/sub: this is my data: {{mydata}}</label>
</div>

This file was deleted.

2 changes: 1 addition & 1 deletion tests/unit/lib/app/addons/ac/test-partial.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ YUI().use('mojito-partial-addon', 'test', function (Y) {
var mockRenderer = Mock();
Mock.expect(mockRenderer, {
method: 'render',
args: [data, 'myInstanceType', Mock.Value.Object, Mock.Value.Object, Mock.Value.Object],
args: [data, command.instance, Mock.Value.Object, Mock.Value.Object, Mock.Value.Object],
run: function (data, type, mojitView, adapter) {
Assert.areEqual('myContentPath', mojitView['content-path']);
adapter.done('renderdone');
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/lib/app/autoload/test-store.server.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ YUI().use(
'server mojit instance views and binders': function() {
var instance = {type:'test_mojit_1'};
store.expandInstanceForEnv('client', instance, {}, function(err, instance) {
A.areSame(3, Y.Object.keys(instance.views).length);
A.areSame(4, Y.Object.keys(instance.views).length);

A.isObject(instance.views['test_1']);
A.areSame('/static/test_mojit_1/views/test_1.hb.html', instance.views['test_1']['content-path']);
Expand Down

0 comments on commit eddaf42

Please sign in to comment.