From 8b9a11575c01ba6a6ca139204df4347c9e9bf16d Mon Sep 17 00:00:00 2001 From: Godwin Date: Thu, 19 Jan 2017 09:33:48 -0800 Subject: [PATCH] Fixed an issue with dataset in IE10 --- app/assets/javascripts/main.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js index feb2bb4..9dd46da 100644 --- a/app/assets/javascripts/main.js +++ b/app/assets/javascripts/main.js @@ -67,8 +67,8 @@ if (msg) { dlg.querySelector('.message').innerHTML = msg.innerHTML } - if (link.dataset.infoTitle) { - dlg.querySelector('.title').innerHTML = decodeURI(link.dataset.infoTitle); + if (link.getAttribute('data-infoTitle')) { + dlg.querySelector('.title').innerHTML = decodeURI(link.getAttribute('data-infoTitle')); } confirmBtn = dlg.querySelector('.confirm'); if (confirmBtn) { @@ -133,7 +133,7 @@ var htmlNode = document.documentElement; document.addEventListener('keydown', function(event) { - if (htmlNode.dataset.input != 'kb' && + if (htmlNode.getAttribute('data-input') != 'kb' && ((["input", "textarea", "select", "option"].indexOf(event.target.nodeName.toLowerCase()) < 0 && !event.target.attributes.contenteditable) || event.key == "Tab")) { htmlNode.setAttribute('data-input', 'kb'); @@ -141,7 +141,7 @@ }); document.addEventListener('mousemove', function(event) { - if (htmlNode.dataset.input != 'mouse' && (event.movementX || event.movementY)) { + if (htmlNode.getAttribute('data-input') != 'mouse' && (event.movementX || event.movementY)) { htmlNode.setAttribute('data-input', 'mouse'); } });