From 2131d1f39affb2ff81abfabbf4ae28785fdb262d Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Mon, 15 Jun 2015 13:07:47 +0200 Subject: [PATCH] Fix jshint. --- accountant/frontend/static/js/accounts.js | 6 +++--- accountant/frontend/static/js/app.js | 7 +++---- accountant/frontend/static/js/entries.js | 6 +++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/accountant/frontend/static/js/accounts.js b/accountant/frontend/static/js/accounts.js index 3878833..fe9f311 100644 --- a/accountant/frontend/static/js/accounts.js +++ b/accountant/frontend/static/js/accounts.js @@ -22,7 +22,7 @@ function account() { this.future=ko.observable(); this.current=ko.observable(); this.pointed=ko.observable(); -}; +} // The AccountController. accountantApp.controller( @@ -43,7 +43,7 @@ accountantApp.controller( $scope.valueClass = function(account, value) { if(!account) { - return + return; } if(value < account.authorized_overdraft) { @@ -156,7 +156,7 @@ accountantApp.controller( // Update accounts $scope.accounts = angular.fromJson(data); - var accountToSelect = null + var accountToSelect = null; // Reset selected account to the new instance corresponding to the old one. if($scope.account) { diff --git a/accountant/frontend/static/js/app.js b/accountant/frontend/static/js/app.js index 1946be9..c409d07 100644 --- a/accountant/frontend/static/js/app.js +++ b/accountant/frontend/static/js/app.js @@ -25,9 +25,8 @@ var accountantApp = angular.module("accountantApp", [ $httpProvider.interceptors.push(function($q) { return { "response": function(response) { - console.debug(response) - if(response.data.ok == false) { - return $q.reject(response) + if(response.data.ok === false) { + return $q.reject(response); } // TODO Intercept validation error. return response; @@ -40,7 +39,7 @@ var accountantApp = angular.module("accountantApp", [ title: response.data.title, text: response.data.text, width: 300 - }) + }); return $q.reject(response); } diff --git a/accountant/frontend/static/js/entries.js b/accountant/frontend/static/js/entries.js index 6b3c66e..de13ed9 100644 --- a/accountant/frontend/static/js/entries.js +++ b/accountant/frontend/static/js/entries.js @@ -224,8 +224,8 @@ accountantApp.controller( // Returns true if the entry is a scheduled one. $scope.isSaved = function(entry) { - return entry.id != null; - } + return entry.id !== null; + }; $scope.iconSaveClass = function(entry) { if(!$scope.isSaved(entry)) { @@ -245,7 +245,7 @@ accountantApp.controller( // Cancel current editing entry or clears field if a new one. $scope.cancelEditEntry = function(entry) { - if ($scope.savedItem == null) { + if ($scope.savedItem === null) { // We are cancelling the new entry, just reset it. entry.id = null; // id should not change, but just in case... entry.pointed = false;