|
|
|
@ -559,18 +559,23 @@
|
|
|
|
|
|
|
|
|
|
initialize:function () {
|
|
|
|
|
|
|
|
|
|
this.clientList = new ClientCollection();
|
|
|
|
|
|
|
|
|
|
this.clientListView = new ClientListView({model:this.clientList});
|
|
|
|
|
|
|
|
|
|
this.breadCrumbView = new BreadCrumbView({
|
|
|
|
|
collection:new Backbone.Collection()
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.breadCrumbView.render();
|
|
|
|
|
|
|
|
|
|
this.startAfter([this.clientList]);
|
|
|
|
|
//this.startAfter([this.clientList]);
|
|
|
|
|
Backbone.history.start();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
clientLoadCheck: function() {
|
|
|
|
|
// check to see if the client collections are already loaded
|
|
|
|
|
// if they aren't then load them
|
|
|
|
|
if (!this.clientList || !this.clientListView) {
|
|
|
|
|
this.clientList = new ClientCollection();
|
|
|
|
|
this.clientListView = new ClientListView({model:this.clientList});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
startAfter:function (collections) {
|
|
|
|
@ -585,6 +590,8 @@
|
|
|
|
|
|
|
|
|
|
listClients:function () {
|
|
|
|
|
|
|
|
|
|
this.clientLoadCheck();
|
|
|
|
|
|
|
|
|
|
this.breadCrumbView.collection.reset();
|
|
|
|
|
this.breadCrumbView.collection.add([
|
|
|
|
|
{text:"Home", href:"/"},
|
|
|
|
@ -598,6 +605,8 @@
|
|
|
|
|
|
|
|
|
|
newClient:function() {
|
|
|
|
|
|
|
|
|
|
this.clientLoadCheck();
|
|
|
|
|
|
|
|
|
|
this.breadCrumbView.collection.reset();
|
|
|
|
|
this.breadCrumbView.collection.add([
|
|
|
|
|
{text:"Home", href:"/"},
|
|
|
|
@ -621,6 +630,8 @@
|
|
|
|
|
|
|
|
|
|
editClient:function(id) {
|
|
|
|
|
|
|
|
|
|
this.clientLoadCheck();
|
|
|
|
|
|
|
|
|
|
this.breadCrumbView.collection.reset();
|
|
|
|
|
this.breadCrumbView.collection.add([
|
|
|
|
|
{text:"Home", href:"/"},
|
|
|
|
@ -647,7 +658,8 @@
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
whiteList:function () {
|
|
|
|
|
$('#content').html(this.whiteListView.render().el);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -667,8 +679,7 @@
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// load templates and append them to the body
|
|
|
|
|
$.get('resources/template/client.html', _load);
|
|
|
|
|
$.get('resources/template/list.html', _load);
|
|
|
|
|
$.get('resources/template/templates.html', _load);
|
|
|
|
|
|
|
|
|
|
jQuery.ajaxSetup({async:true});
|
|
|
|
|
app = new AppRouter();
|
|
|
|
|