Skip to content

Commit

Permalink
skip:update demo (+3 squashed commit)
Browse files Browse the repository at this point in the history
Squashed commits:
[23eee44] skip:update demo
[a74ebd4] skip:update demo
[eb0c307] skip:update demo
sculove authored and Taihoon Kim committed Sep 20, 2016
1 parent d872a58 commit 81c5090
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions test/manual/infiniteGird_demo.html
Original file line number Diff line number Diff line change
@@ -84,7 +84,7 @@ <h2>InfiniteGrid Demo</h2>
return {
offset: v,
imgSrc: "http://naver.github.io/egjs-experiment/infiniteGridService/demo/img/" + ( ( (v + 1) % 60) + 1 ) + ".jpg",
href: "http://naver.com/",
href: "http://www.google.com/",
desc: "Cras justo odio bla bla bla bla bla bla bla bla"
};
});
@@ -93,7 +93,6 @@ <h2>InfiniteGrid Demo</h2>
};
$(function() {
var $grid = $("#grid");
$grid.append(template(data.getItems(0)));

var ig = new eg.InfiniteGrid("#grid", {
count : 60,
@@ -120,22 +119,22 @@ <h2>InfiniteGrid Demo</h2>

// for persist logic
// if($.persist.isNeeded()) {
// if ("scrollRestoration" in history) {
// history.scrollRestoration = "manual";
// }
// $grid.on("click", "a", function(e) {
// $.persist("GRID_PERSIST", {
// "scrollPos": $(document).scrollTop(),
// "grid": ig.getStatus()
// });
// });
// var persistData = $.persist("GRID_PERSIST");
// if($.isEmptyObject(persistData)) {
// ig.append(template(data.getItems(0)), 0);
// } else {
// ig.setStatus(persistData.grid);
// window.scrollTo(0, persistData.scrollPos);
// }
if ("scrollRestoration" in history) {
history.scrollRestoration = "manual";
}
$grid.on("click", "a", function(e) {
$.persist("GRID_PERSIST", {
"scrollPos": $(document).scrollTop(),
"grid": ig.getStatus()
});
});
var persistData = $.persist("GRID_PERSIST");
if($.isEmptyObject(persistData)) {
ig.append(template(data.getItems(0)), 0);
} else {
ig.setStatus(persistData.grid);
window.scrollTo(0, persistData.scrollPos);
}
// } else {
// ig.append(template(data.getItems(0)), 0);
// }

0 comments on commit 81c5090

Please sign in to comment.