Permalink
Browse files

bugfix for dataView

  • Loading branch information...
1 parent 083e1c1 commit cab36ba3c3bd3dbad31bdc49a0adf274c464cd2e @robrobbins robrobbins committed Jul 26, 2013
Showing with 6 additions and 4 deletions.
  1. +2 −1 build/debug/sudo.js
  2. +2 −1 extras/dataview/dataview.js
  3. +2 −2 extras/dataview/spec/dataview.spec.js
View
@@ -900,7 +900,8 @@ sudo.DataView = function(el, data) {
// if autorendering, observe your own model
// use this ref to unobserve if desired
if(this.model.data.autoRender) this.observer = this.model.observe(this.render.bind(this));
- this.build();
+ // only call the initial build if not an autoRender type
+ else this.build();
if(this.role === 'dataview') this.init();
};
// `private`
@@ -24,7 +24,8 @@ sudo.DataView = function(el, data) {
// if autorendering, observe your own model
// use this ref to unobserve if desired
if(this.model.data.autoRender) this.observer = this.model.observe(this.render.bind(this));
- this.build();
+ // only call the initial build if not an autoRender type
+ else this.build();
if(this.role === 'dataview') this.init();
};
// `private`
@@ -28,8 +28,8 @@ describe('sudo.js Dataview Object', function() {
'</div>'
});
- it('exists with the inner content', function() {
- expect(dv.$el.html()).toBeTruthy();
+ it('!exists with the inner content', function() {
+ expect(dv.$el.html()).toBeFalsy();
});
it('renders correctly', function() {

0 comments on commit cab36ba

Please sign in to comment.