Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Chen-Zhe/photo-grid.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Calmettes <guillaume.calmettes@gmail.com>2018-07-29 05:26:56 +0300
committerGuillaume Calmettes <guillaume.calmettes@gmail.com>2018-07-29 05:26:56 +0300
commitb34f0cbe01b05b971aad0ec36b8bf2438c45b111 (patch)
tree182a407b08a0dbc7f000c6d939bb314489ccc6f3
parent40754870b76aed38ef03c720b9d08a1867c4cdcd (diff)
compute correct indexing of children items when multiple og-grid on the same page
-rw-r--r--layouts/partials/scripts.html4
1 files changed, 2 insertions, 2 deletions
diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html
index 93a33ef..4c95802 100644
--- a/layouts/partials/scripts.html
+++ b/layouts/partials/scripts.html
@@ -124,7 +124,7 @@
var Grid = (function() {
- var $grid = $( '#og-grid' ),
+ var $grid = $( '*#og-grid' ),
$items = $grid.children( 'li' ),
current = -1,
previewPos = -1,
@@ -260,7 +260,7 @@
function Preview( $item ) {
this.$item = $item;
- this.expandedIdx = this.$item.index();
+ this.expandedIdx = Array.from($items).findIndex(d => d == this.$item[0]);
this.create();
this.update();
}