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:
Diffstat (limited to 'layouts/partials/scripts.html')
-rw-r--r--layouts/partials/scripts.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html
index 93a33ef..d0d1427 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,
@@ -213,7 +213,7 @@
} ).children( 'a' ).on( 'click', function(e) {
var $item = $( this ).parent();
- current === $item.index() ? hidePreview() : showPreview( $item );
+ current === Array.from($items).findIndex(d => d == $item[0]) ? hidePreview() : showPreview( $item );
return false;
} );
@@ -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();
}