mirror of
https://github.com/fergalmoran/dss.git
synced 2026-01-03 23:44:02 +00:00
49 lines
1.9 KiB
JavaScript
Executable File
49 lines
1.9 KiB
JavaScript
Executable File
// Generated by CoffeeScript 1.4.0
|
|
(function() {
|
|
var __hasProp = {}.hasOwnProperty,
|
|
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
|
|
|
define(['marionette', 'models/activity/activityCollection', 'views/activity/activityItemView', 'text!/tpl/ActivityListView'], function(Marionette, ActivityCollection, ActivityItemView, Template) {
|
|
var ActivityListView;
|
|
ActivityListView = (function(_super) {
|
|
|
|
__extends(ActivityListView, _super);
|
|
|
|
function ActivityListView() {
|
|
return ActivityListView.__super__.constructor.apply(this, arguments);
|
|
}
|
|
|
|
ActivityListView.prototype.template = _.template(Template);
|
|
|
|
ActivityListView.prototype.tagName = "div";
|
|
|
|
ActivityListView.prototype.className = "widget-box";
|
|
|
|
ActivityListView.prototype.itemView = ActivityItemView;
|
|
|
|
ActivityListView.prototype.itemViewContainer = "#activity-container";
|
|
|
|
ActivityListView.prototype.initialize = function() {
|
|
this.collection = new ActivityCollection;
|
|
return this.collection.fetch();
|
|
};
|
|
|
|
ActivityListView.prototype.appendHtml = function(collectionView, itemView, index) {
|
|
var children, childrenContainer;
|
|
childrenContainer = (collectionView.itemViewContainer ? collectionView.$(collectionView.itemViewContainer) : collectionView.$el);
|
|
children = childrenContainer.children();
|
|
if (children.size() <= index) {
|
|
return childrenContainer.append(itemView.el);
|
|
} else {
|
|
return childrenContainer.children().eq(index).before(itemView.el);
|
|
}
|
|
};
|
|
|
|
return ActivityListView;
|
|
|
|
})(Marionette.CompositeView);
|
|
return ActivityListView;
|
|
});
|
|
|
|
}).call(this);
|