Skip to content

Commit

Permalink
feat: 新增檢測拿取資料後table出現後才更改版面功能
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinlinlee committed Jan 30, 2021
1 parent 052cdf4 commit 4ec0117
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
9 changes: 1 addition & 8 deletions views/atm/TS.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,7 @@
angular.element(document.getElementById('setting')).scope().Query(week[weekday]);
var width = (window.innerWidth > 0) ? window.innerWidth : screen.width;
await sleep(100);
if (width <= 736)
{
$("#setting").addClass("table-rwd");
await sleep(100);
HideTd('content');
await sleep(100);
$(`.table-th`).addClass("table-th-show");
}

};

$( "#day_select" ).change(async function()
Expand Down
17 changes: 17 additions & 0 deletions views/atm/scripts/Today_Schedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,22 @@ TSApp.controller("TSCtrl", function ($scope, TSService , commonService) {
$scope.DataList = Today_Schedule;
$scope.DataListLen = $scope.DataList.length;
console.log($scope.DataListLen);
let checkContentExist = setInterval(async function () {
if ($('[id*="setting"]').length) {
let width = $(window).width();
if (width <= 736)
{
$("#setting").addClass("table-rwd");
await sleep(100);
HideTd('content');
await sleep(100);
$(`.table-th`).addClass("table-th-show");
}
clearInterval(checkContentExist);
//$.unblockUI();
}
}, 100);

}
}));
}
Expand All @@ -36,6 +52,7 @@ TSApp.service("TSService", function ($http) {
url: "api/Today_Schedule",
params:
{
semno: '1091' ,
User: Querykey,
day: weekday
}
Expand Down

0 comments on commit 4ec0117

Please sign in to comment.