Browse Source

Fixed an issue with dataset in IE10

development
Godwin 8 years ago
committed by GitHub
parent
commit
8b9a11575c
  1. 8
      app/assets/javascripts/main.js

8
app/assets/javascripts/main.js

@ -67,8 +67,8 @@
if (msg) { if (msg) {
dlg.querySelector('.message').innerHTML = msg.innerHTML dlg.querySelector('.message').innerHTML = msg.innerHTML
} }
if (link.dataset.infoTitle) { if (link.getAttribute('data-infoTitle')) {
dlg.querySelector('.title').innerHTML = decodeURI(link.dataset.infoTitle); dlg.querySelector('.title').innerHTML = decodeURI(link.getAttribute('data-infoTitle'));
} }
confirmBtn = dlg.querySelector('.confirm'); confirmBtn = dlg.querySelector('.confirm');
if (confirmBtn) { if (confirmBtn) {
@ -133,7 +133,7 @@
var htmlNode = document.documentElement; var htmlNode = document.documentElement;
document.addEventListener('keydown', function(event) { 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 && ((["input", "textarea", "select", "option"].indexOf(event.target.nodeName.toLowerCase()) < 0 &&
!event.target.attributes.contenteditable) || event.key == "Tab")) { !event.target.attributes.contenteditable) || event.key == "Tab")) {
htmlNode.setAttribute('data-input', 'kb'); htmlNode.setAttribute('data-input', 'kb');
@ -141,7 +141,7 @@
}); });
document.addEventListener('mousemove', function(event) { 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'); htmlNode.setAttribute('data-input', 'mouse');
} }
}); });

Loading…
Cancel
Save