Compatibility with XHTML documents
Previously, when the XHTML doctype + header is active, checks would fail because a <div>'s tag name is "div" instead of "DIV". document.activeElement does not exist in Chrome for XHTML documents == -> ===
This commit is contained in:
parent
e181a3c902
commit
b46c375126
@ -46,7 +46,7 @@ var FontInspector = (function FontInspectorClosure() {
|
||||
}
|
||||
}
|
||||
function textLayerClick(e) {
|
||||
if (!e.target.dataset.fontName || e.target.tagName != 'DIV')
|
||||
if (!e.target.dataset.fontName || e.target.tagName.toUpperCase() !== 'DIV')
|
||||
return;
|
||||
var fontName = e.target.dataset.fontName;
|
||||
var selects = document.getElementsByTagName('input');
|
||||
|
@ -3494,9 +3494,9 @@ window.addEventListener('keydown', function keydown(evt) {
|
||||
|
||||
// Some shortcuts should not get handled if a control/input element
|
||||
// is selected.
|
||||
var curElement = document.activeElement;
|
||||
if (curElement && (curElement.tagName == 'INPUT' ||
|
||||
curElement.tagName == 'SELECT')) {
|
||||
var curElement = document.activeElement || document.querySelector(':focus');
|
||||
if (curElement && (curElement.tagName.toUpperCase() === 'INPUT' ||
|
||||
curElement.tagName.toUpperCase() === 'SELECT')) {
|
||||
return;
|
||||
}
|
||||
var controlsElement = document.getElementById('toolbar');
|
||||
|
Loading…
x
Reference in New Issue
Block a user