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

Commit eddaf42

Browse files
author
lzhan
committed
Merge pull request #1315 from lzhan/next
Add this fix to next branch: Fix issue #1306: ac.partial.render() throws error for handlebar custom helper
2 parents ca7f195 + 9693614 commit eddaf42

File tree

10 files changed

+21
-14
lines changed

10 files changed

+21
-14
lines changed

HISTORY.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,18 @@ Features
1313
Bug Fixes
1414
---------
1515

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

1818
Acknowledgements
1919
----------------
2020

21+
version 0.8.2
22+
=================
23+
24+
Bug Fixes
25+
---------
26+
27+
* Issue #1280: Composite.execute cannot be called multiple times in the same mojit
2128

2229
version 0.8.1
2330
=================

lib/app/addons/ac/partial.common.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ YUI.add('mojito-partial-addon', function (Y, NAME) {
6363

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

66-
renderer.render(data, instance.type, mojitView, new Y.mojito.OutputBuffer(id, cb), meta);
66+
renderer.render(data, instance, mojitView, new Y.mojito.OutputBuffer(id, cb), meta);
6767
},
6868

6969
/**

lib/app/autoload/store.server.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -743,11 +743,11 @@ YUI.add('mojito-resource-store', function(Y, NAME) {
743743
if (res.name.indexOf('partials/') === 0) {
744744
// removing the "partials/" prefix
745745
details.partials[this._libs.path.basename(res.name)] = template;
746-
} else {
747-
details.views[res.name] = template;
748-
details.views[res.name].assets = res.view.assets;
749-
details.views[res.name].engine = res.view.engine;
750746
}
747+
details.views[res.name] = template;
748+
details.views[res.name].assets = res.view.assets;
749+
details.views[res.name].engine = res.view.engine;
750+
751751
continue;
752752
}
753753

tests/func/applications/frameworkapp/common/mojits/ACMojit/controller.common.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ YUI.add('ActionContextMojit', function(Y, NAME) {
6161
}else if(test=="done8"){
6262
ac.done({data:"Hello, world!--from done"}, {view: {name: "mytemplate"}});
6363
}else if(test=="done9"){
64-
ac.done({ foo: null }, {view: {name: "mytemplate1"}});
64+
ac.done({ foo: null }, {view: {name: "testdir/mytemplate1"}});
6565
}else if(test=="done10"){
66-
ac.done({ foo: [ 1, 2, null, 4 ]}, {view: {name: "mytemplate1"}} );
66+
ac.done({ foo: [ 1, 2, null, 4 ]}, {view: {name: "testdir/mytemplate1"}} );
6767
}else if(test=="flush8"){
6868
ac.flush({data:"Hello, world!--from flush"}, {view: {name: "mytemplate"}});
6969
ac.done();

tests/func/applications/frameworkapp/common/mojits/PartialMojit/controller.common.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ YUI.add('PartialMojit', function(Y, NAME) {
4343
ac.done(mymarkup);
4444
});*/
4545
//ac.done(data);
46-
ac.partial.render(data, "sub", function(error, mymarkup){
46+
ac.partial.render(data, "partials/sub", function(error, mymarkup){
4747
Y.log("HereController....."+mymarkup);
4848
ac.done(mymarkup);
4949
})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div id="{{mojit_view_id}}" class="sub">
2+
<label id="subdata">From partials/sub: this is my data: {{mydata}}</label>
3+
</div>

tests/func/applications/frameworkapp/common/mojits/PartialMojit/views/sub.mu.html

-3
This file was deleted.

tests/unit/lib/app/addons/ac/test-partial.common.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ YUI().use('mojito-partial-addon', 'test', function (Y) {
7070
var mockRenderer = Mock();
7171
Mock.expect(mockRenderer, {
7272
method: 'render',
73-
args: [data, 'myInstanceType', Mock.Value.Object, Mock.Value.Object, Mock.Value.Object],
73+
args: [data, command.instance, Mock.Value.Object, Mock.Value.Object, Mock.Value.Object],
7474
run: function (data, type, mojitView, adapter) {
7575
Assert.areEqual('myContentPath', mojitView['content-path']);
7676
adapter.done('renderdone');

tests/unit/lib/app/autoload/test-store.server.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ YUI().use(
149149
'server mojit instance views and binders': function() {
150150
var instance = {type:'test_mojit_1'};
151151
store.expandInstanceForEnv('client', instance, {}, function(err, instance) {
152-
A.areSame(3, Y.Object.keys(instance.views).length);
152+
A.areSame(4, Y.Object.keys(instance.views).length);
153153

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

0 commit comments

Comments
 (0)