Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function Dashboard() {
if (!(this instanceof Dashboard)) {
return new Dashboard();
}
// Define template
View.call(this, template);
/**
* Model of each item on the list.
* @type {Array}
*/
this.items = [];
this.loadItems();
}
function DiffView() {
if (!this instanceof DiffView) {
return new DiffView();
}
View.call(this, template);
this.sections = [];
}
function DeploymentView(locals) {
if (!(this instanceof DeploymentView)) {
return new DeploymentView(name);
};
View.call(this, template, locals);
this.url = locals.url;
}
function HeaderView() {
View.call(this, template);
this.user = this.el.find('.user');
}
function Dashboard() {
if (!(this instanceof Dashboard)) {
return new Dashboard();
};
View.call(this, template, { motto: t('dashboard.motto') });
/**
* DOM elements
*/
this.elDeployments = this.el.find('.deployments')[0];
/**
* View model
*/
this.deployments = [];
/**
* Startup
*/
function ItemView(item) {
var element = tmpl.cloneNode(true);
element.querySelector('.name').textContent = item.name;
View.call(this, item, element);
this.bind('click .remove', 'remove');
this.bind('click .done', 'complete');
}