From: Heekyoung, Oh Date: Thu, 20 Apr 2017 06:25:17 +0000 (+0900) Subject: [TIC-Web] Bug fixed. the problem that paging X-Git-Tag: v20170428~9^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F04%2F126104%2F1;p=archive%2F20170607%2Ftools%2Ftic.git [TIC-Web] Bug fixed. the problem that paging - bug fixed. - the problem that paging - now, it can point the page num exactly - apply the section of jobs and images Change-Id: I063d59a341caf7a1273ac6e15ea904abb3b9cc11 Signed-off-by: Heekyoung, Oh --- diff --git a/public/src/js/model/JobPagingModel.js b/public/src/js/model/JobPagingModel.js index a4028c1..ea18841 100644 --- a/public/src/js/model/JobPagingModel.js +++ b/public/src/js/model/JobPagingModel.js @@ -46,11 +46,11 @@ define([ this.maxPoint = 5; this.itemsOnPage = 10; - this.init(paramObj); + this.update(paramObj); } - JobPagingModel.prototype.init = function (obj) { - logger.info('JobPagingModel.init : ' + JSON.stringify(obj)); + JobPagingModel.prototype.update = function (obj) { + logger.info('JobPagingModel.update : ' + JSON.stringify(obj)); this.setTotalCount(obj.totalCount); this.setCurrentPoint(obj.currentPageNum); diff --git a/public/src/js/page/image.js b/public/src/js/page/image.js index 857eb74..cb05e04 100644 --- a/public/src/js/page/image.js +++ b/public/src/js/page/image.js @@ -129,11 +129,10 @@ define([ function _updatePagingModel(result) { return new Promise(function (resolve, reject) { - logger.info('_updatePagingModel'); - // initialize var totalCount = 0; - $('#tic-image-list-pagination').empty(); + + logger.info('_updatePagingModel'); // set totalCount totalCount = Number(result[0].total_count); @@ -142,7 +141,12 @@ define([ ModelImagePaging = new JobPagingModel({ totalCount: totalCount, currentPageNum: pageNum - }) + }); + } else { + ModelImagePaging.update({ + totalCount: totalCount, + currentPageNum: pageNum + }); } resolve(ModelImagePaging); diff --git a/public/src/js/page/job.js b/public/src/js/page/job.js index 23e186b..ac0995b 100644 --- a/public/src/js/page/job.js +++ b/public/src/js/page/job.js @@ -208,11 +208,9 @@ define([ function _updatePagingModel(result) { return new Promise(function (resolve, reject) { - logger.info('_updatePagingModel'); - // initialize var totalCount = 0; - $('#tic-job-list-pagination').empty(); + logger.info('_updatePagingModel'); // set totalCount totalCount = Number(result[0].total_count); @@ -221,7 +219,12 @@ define([ ModelJobPaging = new JobPagingModel({ totalCount: totalCount, currentPageNum: pageNum - }) + }); + } else { + ModelJobPaging.update({ + totalCount: totalCount, + currentPageNum: pageNum + }); } resolve(ModelJobPaging);