Commit 4ab0ac1f by hoangson

implement init sort index active

parent a887b0de
......@@ -51,7 +51,11 @@ CHK_Footer.isIndexPage = function() {
CHK_Footer.goIndexPage = function(tabId) {
sessionStorage.activeTab = tabId;
CHK.goUrlWithCurrentParams('index.html', {activeTab: tabId});
var params = {activeTab: tabId};
if (typeof sessionStorage.sortIndex != 'undefined') {
params.sortIndex = sessionStorage.sortIndex;
}
CHK.goUrlWithCurrentParams('index.html', params);
}
CHK_Footer.activeDashboardBottomNav = function() {
......
......@@ -344,7 +344,7 @@ CHK.hasAddTaskAuthority = function() {
CHK.sessionKeys = [
'reportType', 'isCms', 'isWeb', 'isWindows', 'isAndroid', 'isIOS', 'isRFIDBarcodeScan', 'isOperationGroupMaster',
'lang', 'debug', 'isMobile', 'isChat',
'sortIndex', 'lang', 'debug', 'isMobile', 'isChat',
];
CHK.loadSessionData = function() {
......@@ -395,6 +395,19 @@ CHK.goUrlWithCurrentParams = function(url, params) {
}
}
CHK.initActiveSortIndex = function(sortIndex) {
if (typeof sortIndex == 'undefined') {
return;
}
$(".sort-type").each(function() {
var sortType = $(this).data("sort");
if (sortType == CHK.sortIndex) {
$(".sort-type").removeClass("active");
$(this).addClass("active");
}
});
}
// 共通初期処理
CHK.initCommon = function() {
//JSON初期化
......@@ -459,6 +472,7 @@ CHK.initCommon = function() {
$("#checkList").css("min-width", "400px");
}
CHK.initActiveSortIndex(CHK.sortIndex);
}
/**
......@@ -3086,6 +3100,7 @@ CHK.changeSortType = function(sortType) {
$(".sort-type").removeClass("active");
$(sortType).addClass("active");
CHK.sortIndex = $(sortType).attr("data-sort");
sessionStorage.sortIndex = CHK.sortIndex;
CHK.createOperationList(CHK.operation.operationList, true);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment