From 3bf77b226c9ac4ed5834baeb192cd12a56da74fc Mon Sep 17 00:00:00 2001 From: Ethan Czahor Date: Wed, 22 Feb 2012 15:30:54 -0800 Subject: [PATCH] bug fix for browsers that don't support HTML5 dataset attribute --- src/EasyScroller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EasyScroller.js b/src/EasyScroller.js index 018f13d..8c2d09f 100644 --- a/src/EasyScroller.js +++ b/src/EasyScroller.js @@ -185,8 +185,8 @@ document.addEventListener("DOMContentLoaded", function() { for (var i = 0; i < elements.length; i++) { element = elements[i]; - var scrollable = element.dataset.scrollable; - var zoomable = element.dataset.zoomable || ''; + var scrollable = element.attributes.getNamedItem('data-scrollable') ? element.attributes.getNamedItem('data-scrollable').value : null; + var zoomable = element.attributes.getNamedItem('data-zoomable') ? element.attributes.getNamedItem('data-zoomable').value : ''; var zoomOptions = zoomable.split('-'); var minZoom = zoomOptions.length > 1 && parseFloat(zoomOptions[0]); var maxZoom = zoomOptions.length > 1 && parseFloat(zoomOptions[1]);