Skip to content

Commit

Permalink
Added optional data property
Browse files Browse the repository at this point in the history
  • Loading branch information
asciidisco committed Jul 24, 2012
1 parent fa3c172 commit c006143
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions backbone.marionette.handlebars.js
@@ -1,6 +1,6 @@
/*! Backbone.Marionette.Handlebars - v0.1.0
/*! Backbone.Marionette.Handlebars - v0.2.0
------------------------------
Build @ 2012-07-10
Build @ 2012-07-24
Documentation and Full License Available at:
http://asciidisco.github.com/Backbone.Marionette.Handlebars/index.html
git://github.com/asciidisco/Backbone.Marionette.Handlebars.git
Expand Down Expand Up @@ -50,7 +50,7 @@ IN THE SOFTWARE.*/
oldRender = Backbone.Marionette.Renderer.render;
Backbone.Marionette.Renderer.render = function (template, data) {
if (_.isObject(template) && template.type === 'handlebars') {
return template.template(data, template.options);
return template.template(_.extend(data, template.data), template.options);
}

return oldRender(template, data);
Expand Down
6 changes: 3 additions & 3 deletions backbone.marionette.handlebars.min.js
@@ -1,6 +1,6 @@
/*! Backbone.Marionette.Handlebars - v0.1.0
/*! Backbone.Marionette.Handlebars - v0.2.0
------------------------------
Build @ 2012-07-10
Build @ 2012-07-24
Documentation and Full License Available at:
http://asciidisco.github.com/Backbone.Marionette.Handlebars/index.html
git://github.com/asciidisco/Backbone.Marionette.Handlebars.git
Expand All @@ -23,4 +23,4 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.*/
(function(a,b,c,d,e,f,g){"use strict",typeof d=="object"?e.exports=f(c("underscore"),c("backbone"),c("backbone.marionette")):typeof b=="function"&&b.amd?b(["underscore","backbone","backbone.marionette"],function(b,c){return b=b===g?a._:b,c=c===g?a.Backbone:c,a.returnExportsGlobal=f(b,c,a)}):a.returnExportsGlobal=f(a._,a.Backbone)})(this,this.define,this.require,this.exports,this.module,function(a,b,c,d){"use strict";var e;return e=b.Marionette.Renderer.render,b.Marionette.Renderer.render=function(b,c){return a.isObject(b)&&b.type==="handlebars"?b.template(c,b.options):e(b,c)},b.Marionette});
(function(a,b,c,d,e,f,g){"use strict",typeof d=="object"?e.exports=f(c("underscore"),c("backbone"),c("backbone.marionette")):typeof b=="function"&&b.amd?b(["underscore","backbone","backbone.marionette"],function(b,c){return b=b===g?a._:b,c=c===g?a.Backbone:c,a.returnExportsGlobal=f(b,c,a)}):a.returnExportsGlobal=f(a._,a.Backbone)})(this,this.define,this.require,this.exports,this.module,function(a,b,c,d){"use strict";var e;return e=b.Marionette.Renderer.render,b.Marionette.Renderer.render=function(b,c){return a.isObject(b)&&b.type==="handlebars"?b.template(a.extend(c,b.data),b.options):e(b,c)},b.Marionette});
2 changes: 1 addition & 1 deletion src/backbone.marionette.handlebars.js
Expand Up @@ -24,7 +24,7 @@
oldRender = Backbone.Marionette.Renderer.render;
Backbone.Marionette.Renderer.render = function (template, data) {
if (_.isObject(template) && template.type === 'handlebars') {
return template.template(data, template.options);
return template.template(_.extend(data, template.data), template.options);
}

return oldRender(template, data);
Expand Down

0 comments on commit c006143

Please sign in to comment.