Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

trigger a render event on component render

  • Loading branch information...
commit 4a2513f08ad1e49265675de3fa71612dff50c1a7 1 parent 5bbf86a
@rmurphey authored
Showing with 8 additions and 0 deletions.
  1. +1 −0  app/components/base.js
  2. +7 −0 tests/app/components/base.js
View
1  app/components/base.js
@@ -18,6 +18,7 @@ define([
data = this.model ? this.model.toJSON() : this;
this.$el.html(tpl(data));
+ this.trigger('render');
return this;
},
View
7 tests/app/components/base.js
@@ -32,6 +32,13 @@ define([ 'app/components/base' ], function(C) {
var ret = c.render();
expect(ret).to.be(c);
});
+
+ it("should trigger a render event", function() {
+ var flag;
+ c.on('render', function() { flag = true; });
+ c.render();
+ expect(flag).to.be(true);
+ });
});
describe("#placeAt", function() {
Please sign in to comment.
Something went wrong with that request. Please try again.