From 631b7f50f522158db86af4a029cc3b9f077f4a1b Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Sat, 12 Jan 2013 15:51:00 +0100 Subject: [PATCH] Cleaned up a bit the javascript source. --- src/html/js/entries.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/html/js/entries.js b/src/html/js/entries.js index af608f0..4026c60 100644 --- a/src/html/js/entries.js +++ b/src/html/js/entries.js @@ -25,7 +25,6 @@ function message(alertType, title, message) { var ListViewModel = function() { var self = this; - window.viewModel = self; self.account = ko.observable(); self.accounts = ko.observableArray([]); @@ -275,8 +274,6 @@ var ListViewModel = function() { self.loadMonths(account); } }; - - $(document).ready(self.loadAccounts); }; function dateToString(date) { @@ -421,5 +418,9 @@ ko.bindingHandlers.chart = { } }; -ko.applyBindings(new ListViewModel()); +var viewModel = new ListViewModel(); + +ko.applyBindings(viewModel); + +$(viewModel.loadAccounts);