This is the code I think I want, but it is never executed.
App.ThumbnailScrollerView = Ember.View.extend({
tagName: "div",
didInsertElement: function() {
return this.get("controller.content").addObserver("isLoaded", function() {
return $(".jThumbnailScroller").thumbnailScroller;
});
}
});
This code is executed, but once for each object, I really only want it for the last object.
App.ThumbnailScrollerView = Ember.View.extend({
tagName: "div",
didInsertElement: function() {
return this.get("controller.content.@each").addObserver("isLoaded", function() {
return $(".jThumbnailScroller").thumbnailScroller;
});
}
});
This is also never executed.
App.ThumbnailScrollerView = Ember.View.extend({
tagName: "div",
didInsertElement: function() {
return this.get("controller.content.lastObject").addObserver("isLoaded", function() {
return $(".jThumbnailScroller").thumbnailScroller;
});
}
});
Asked on SO http://stackoverflow.com/questions/17851533/initialize-a-jquery-plugin-when-the-content-for-an-ember-view-has-loaded