From f9e814febc2629d1dc76480e51d1d4fbda1f62e8 Mon Sep 17 00:00:00 2001 From: Maigo Erit Date: Mon, 29 Feb 2016 19:01:59 +0200 Subject: [PATCH] Cleanup tray --- plugins/tray/app/app.module.js | 1 - .../trackItem/trackItem.list.controller.js | 43 +------------------ plugins/tray/index.html | 3 -- 3 files changed, 1 insertion(+), 46 deletions(-) diff --git a/plugins/tray/app/app.module.js b/plugins/tray/app/app.module.js index b6aebaf1..c55e204e 100755 --- a/plugins/tray/app/app.module.js +++ b/plugins/tray/app/app.module.js @@ -10,7 +10,6 @@ angular.module('trayApp', [ 'trayApp.config', 'trayApp.runtime-config', 'pascalprecht.translate', - 'js-data', 'mdColorPicker', 'ngMaterialDatePicker', 'md.data.table', diff --git a/plugins/tray/app/trackItem/trackItem.list.controller.js b/plugins/tray/app/trackItem/trackItem.list.controller.js index 63bbcef7..6c073a4d 100755 --- a/plugins/tray/app/trackItem/trackItem.list.controller.js +++ b/plugins/tray/app/trackItem/trackItem.list.controller.js @@ -5,46 +5,5 @@ angular.module('trayApp') .controller('TrackItemListController', function (TrackItemService, $rootScope) { var ctrl = this; - ctrl.maxDate = new Date(); - - - function getTomorrow(d) { - return new Date(d.getFullYear(), d.getMonth(), d.getDate() + 1) - } - - var today = new Date(); - var tomorrow = getTomorrow(today); - ctrl.searchDate = today; - - today.setHours(0, 0, 0, 0); - console.log(today, tomorrow); - - - var PAGE_SIZE = 50; - var currentPage = 1; - ctrl.list = function () { - console.log("Refresh data"); - - TrackItemService.findAll({ - offset: PAGE_SIZE * (currentPage - 1), - limit: PAGE_SIZE, - orderBy: [ - ['beginDate', 'DESC'] - ], where: { - beginDate: { - '>': ctrl.searchDate, - '<': getTomorrow(ctrl.searchDate) - } - } - }, { - keepChangeHistory: false, - cacheResponse: false - }).then(function (items) { - ctrl.trackItems = items; - $rootScope.$apply(); - }); - }; - - ctrl.list(); - + }); diff --git a/plugins/tray/index.html b/plugins/tray/index.html index aaa71618..8bd072ed 100755 --- a/plugins/tray/index.html +++ b/plugins/tray/index.html @@ -29,9 +29,6 @@ - - -