[TIC-Web] Bug fixed. the problem that paging 04/126104/1
authorHeekyoung, Oh <heekyoung.oh@samsung.com>
Thu, 20 Apr 2017 06:25:17 +0000 (15:25 +0900)
committerHeekyoung, Oh <heekyoung.oh@samsung.com>
Thu, 20 Apr 2017 06:28:23 +0000 (15:28 +0900)
- 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 <heekyoung.oh@samsung.com>
public/src/js/model/JobPagingModel.js
public/src/js/page/image.js
public/src/js/page/job.js

index a4028c1..ea18841 100644 (file)
@@ -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);
index 857eb74..cb05e04 100644 (file)
@@ -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);
index 23e186b..ac0995b 100644 (file)
@@ -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);