From 5419e335b80ad03f84c95423b1b6c1072e63a3b7 Mon Sep 17 00:00:00 2001 From: Lanza Date: Tue, 22 Nov 2016 22:51:52 +0100 Subject: [PATCH] Fixes #4 : scope issue on event handler args --- flex-images.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/flex-images.js b/flex-images.js index 3afa085..9089b10 100644 --- a/flex-images.js +++ b/flex-images.js @@ -55,6 +55,12 @@ var flexImages = (function(){ for (var k in options) { if (options.hasOwnProperty(k)) o[k] = options[k]; } var grids = typeof o.selector == 'object' ? [o.selector] : document.querySelectorAll(o.selector); + function _makeTempf(currentGrid, currentItems) { + var grid = currentGrid; + var items = currentItems; + this.eventHandler = function() { makeGrid(grid, items, o); } + } + for (var i=0;i