summaryrefslogtreecommitdiff
path: root/js/inline-expanding.js
diff options
context:
space:
mode:
author8chan <admin@8chan.co>2015-02-20 01:51:06 -0800
committerczaks <marcin@6irc.net>2016-05-05 12:15:26 +0200
commit5176377045d25ab00ed4653f980e9a95a17b0e31 (patch)
treea08ae71b97697b7d576c0e6f9d243d4be0acc59c /js/inline-expanding.js
parent88f6088a429fb73d12805377b43c6b567d03a5db (diff)
Fix many features for Internet Explorer 9 and 10
Please don't use "dataset" in scripts anymore, it doesn't work in IE9 or 10. Instead use $.data
Diffstat (limited to 'js/inline-expanding.js')
-rw-r--r--js/inline-expanding.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/js/inline-expanding.js b/js/inline-expanding.js
index 92069689..e316fbb7 100644
--- a/js/inline-expanding.js
+++ b/js/inline-expanding.js
@@ -48,8 +48,8 @@ $(document).ready(function(){
if (i > -1) {
waiting.splice(i, 1);
}
- if (ele.dataset.imageLoading === 'true') {
- ele.dataset.imageLoading = 'false';
+ if ($(ele).data('imageLoading') === 'true') {
+ $(ele).data('imageLoading', 'false');
clearTimeout(ele.timeout);
--loading;
}
@@ -73,7 +73,7 @@ $(document).ready(function(){
$.when($loadstart).done(function () {
// once fully loaded, update the waiting queue
--loading;
- ele.dataset.imageLoading = 'false';
+ $(ele).data('imageLoading', 'false');
update();
});
});
@@ -83,7 +83,7 @@ $(document).ready(function(){
});
img.setAttribute('src', ele.href);
- ele.dataset.imageLoading = 'true';
+ $(ele).data('imageLoading', 'true');
ele.timeout = onLoadStart(img);
});
@@ -112,9 +112,9 @@ $(document).ready(function(){
return false;
if (e.which == 2 || e.ctrlKey) // open in new tab
return true;
- if (!this.dataset.expanded) {
+ if (!$(this).data('expanded')) {
this.parentNode.removeAttribute('style');
- this.dataset.expanded = 'true';
+ $(this).data('expanded', 'true');
if (thumb.tagName === 'CANVAS') {
canvas = thumb;
@@ -144,12 +144,12 @@ $(document).ready(function(){
}
if (~this.parentNode.className.indexOf('multifile'))
- this.parentNode.style.width = (parseInt(this.dataset.width)+40)+'px';
+ this.parentNode.style.width = (parseInt($(this).data('width'))+40)+'px';
thumb.style.opacity = '';
thumb.style.display = '';
if (thumb.nextSibling) this.removeChild(thumb.nextSibling); //full image loaded or loading
- delete this.dataset.expanded;
+ $(this).removeData('expanded');
delete thumb.style.filter;
// do the scrolling after page reflow