diff --git a/views/atm/History_Scores.html b/views/atm/History_Scores.html index 1054aa7..0667fdf 100644 --- a/views/atm/History_Scores.html +++ b/views/atm/History_Scores.html @@ -13,15 +13,11 @@ - - + - + @@ -33,21 +29,7 @@
+
@@ -93,10 +74,10 @@ {{hs.Sem}}{{item.$index}} {{hs.Type}} {{hs.Course}} - {{hs.Up_Credit}} - {{hs.Up_Score}} - {{hs.Down_Credit}} - {{hs.Down_Score}} + {{hs.Up_Credit}} + {{hs.Up_Score}} + {{hs.Down_Credit}} + {{hs.Down_Score}} {{Con_hs.title}} @@ -122,9 +103,11 @@ - + + + @@ -141,7 +124,7 @@ } }); window.onload = async function() { - commonFunc.darkModeInit(); + commonFunc.myDarkModeInit(); await sleep(500); angular.element(document.getElementById('container')).scope().Query(); var width = (window.innerWidth > 0) ? window.innerWidth : screen.width; @@ -161,22 +144,4 @@ $('html, body').animate({scrollTop:0}, '300'); }); }; - window.onresize = async function () { - let width = (window.innerWidth > 0) ? window.innerWidth : screen.width; - if (width <= 736) - { - $("[id*='HStable_']").addClass("table-rwd"); - TdDisplay('content'); - $("[id*=_content_empty]").each(function () { - if (!$(this).text()) { - $(this).hide(); - } - }) - } - else - { - $("[id*='HStable_']").removeClass("table-rwd"); - TdDisplayNoneRWD('content'); - } - } \ No newline at end of file diff --git a/views/atm/scripts/History_Scores.js b/views/atm/scripts/History_Scores.js index 7f8f433..695633c 100644 --- a/views/atm/scripts/History_Scores.js +++ b/views/atm/scripts/History_Scores.js @@ -1,20 +1,21 @@ -var HSApp = angular.module("HSApp" ,[]); -HSApp.controller("HSCtrl" , function($scope , HSService) +var HSApp = angular.module("HSApp" ,["commonApp"]); +HSApp.controller("HSCtrl" , function($scope , HSService , commonService) { $scope.DataList = []; $scope.Conlist = []; $scope.Sems = []; $scope.Currentuser = ""; - $scope.showItemEmpty = false; + commonService.user.getStuInfo().then(function (res) { + $scope.Currentuser = res.data; + }); + //$scope.showItemEmpty = false; let width = (window.innerWidth > 0) ? window.innerWidth : screen.width; $scope.Ismobile = (width <= 736) ? true : false; - HSService.Get_User($scope); $scope.Query = function () { - HSService.Get_User($scope); - HSService.Get_data($scope.Currentuser).then((function(res) + HSService.Get_data().then((function(res) { if (res.status == 401) { @@ -40,18 +41,37 @@ HSApp.controller("HSCtrl" , function($scope , HSService) { let width = (window.innerWidth > 0) ? window.innerWidth : screen.width; $scope.Ismobile = (width <= 736) ? true : false; + showItemEmpty = false; if ($scope.Ismobile && i_item !="") { - $scope.showItemEmpty = true; - return $scope.showItemEmpty; + showItemEmpty = true; + return showItemEmpty; } else if (!$scope.Ismobile) { - $scope.showItemEmpty = true; - return $scope.showItemEmpty; + showItemEmpty = true; + return showItemEmpty; + } + return showItemEmpty; + } + window.onresize = async function () { + let width = (window.innerWidth > 0) ? window.innerWidth : screen.width; + if (width <= 736) + { + $("[id*='HStable_']").addClass("table-rwd"); + TdDisplay('content'); + $("[id*=_content_empty]").each(function () { + if (!$(this).text()) { + $(this).hide(); + } + }); + } + else + { + $("[id*='HStable_']").removeClass("table-rwd"); + TdDisplayNoneRWD('content'); + $scope.$apply(); } - $scope.showItemEmpty = false; - return $scope.showItemEmpty; } }); @@ -59,28 +79,15 @@ HSApp.service("HSService" , function($http) { return ( { - Get_User : Get_User , Get_data : Get_data } ); - function Get_User($scope) - { - var request =$http.get('/api/user').then(function(result) - { - $scope.Currentuser = result.data; - }); - return request.then(handleSuccess , handleError); - } - function Get_data(Querykey) + function Get_data() { var request = $http( { method: "GET", url : "api/History_Scores", - params : - { - User : Querykey - } } ); return (request.then(handleSuccess , handleError));