Skip to content

Commit

Permalink
Fix epoxy inline bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
Maksim Koretskiy committed Mar 20, 2015
1 parent 6649e7f commit b11c6ee
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 4 deletions.
7 changes: 5 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "backbone-mixin",
"version": "0.3.5",
"version": "0.3.6",
"authors": [
"[email protected]"
],
Expand All @@ -25,5 +25,8 @@
"Epoxy",
"mixin"
],
"private": false
"private": false,
"devDependencies": {
"backbone.epoxy": "~1.3.1"
}
}
3 changes: 3 additions & 0 deletions build/backbone-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,9 @@ MixinBackbone = function(Backbone) {
if (!this.bindings) {
return;
}
if (this.bindings === "data-bind") {
return;
}
this.unbindUIEpoxy();
this._$_p.var_bindings = this.bindings;
rx = /@ui\.([^ ]+)/;
Expand Down
2 changes: 1 addition & 1 deletion build/backbone-mixin.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/backbone-mixin.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ MixinBackbone = (Backbone)->
#
bindUIEpoxy:->
return unless @bindings
return if @bindings is "data-bind"
@unbindUIEpoxy()
@_$_p.var_bindings = @bindings
rx = /@ui\.([^ ]+)/
Expand Down
1 change: 1 addition & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module.exports = function(config) {
'bower_components/jquery/jquery.js',
'bower_components/lodash/dist/lodash.min.js',
'bower_components/backbone/backbone.js',
'bower_components/backbone.epoxy/backbone.epoxy.js',
'dist/backbone-mixin.coffee',
//'build/backbone-mixin.js',
'test/*-spec.coffee'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "backbone-mixin",
"version": "0.3.5",
"version": "0.3.6",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
20 changes: 20 additions & 0 deletions test/check-epoxyInlineBindings-spec.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
describe "Epoxy inline bindings",->
beforeEach ->
$('body').html """
<div id='view'>
<h1 data-bind="text: title"></h1>
</div>
"""

afterEach ->
$('#view').remove()

it "check inline binding works", ->
TestView = MixinBackbone(Backbone.Epoxy.View).extend
el: '#view'
model: new (Backbone.Model.extend
defaults:
title: "Title"
)
view = new TestView
expect(view.$('h1').text()).toEqual "Title"

0 comments on commit b11c6ee

Please sign in to comment.