Change srcElement to target

(srcElement is non-standard)
This commit is contained in:
j433866 2019-04-04 13:13:21 +01:00
parent de21f14fd8
commit 8739dd97d6
2 changed files with 9 additions and 9 deletions

View file

@ -533,9 +533,9 @@ class InputWaiter {
inputOpen(e) {
e.preventDefault();
if (e.srcElement.files.length > 0) {
this.loadUIFiles(e.srcElement.files);
e.srcElement.value = "";
if (e.target.files.length > 0) {
this.loadUIFiles(e.target.files);
e.target.value = "";
}
}
@ -880,10 +880,10 @@ class InputWaiter {
* @param {event} mouseEvent
*/
removeTabClick(mouseEvent) {
if (!mouseEvent.srcElement) {
if (!mouseEvent.target) {
return;
}
const tabNum = mouseEvent.srcElement.parentElement.parentElement.getAttribute("inputNum");
const tabNum = mouseEvent.target.parentElement.parentElement.getAttribute("inputNum");
if (tabNum) {
this.removeTab(parseInt(tabNum, 10));
}
@ -986,10 +986,10 @@ class InputWaiter {
* @param {event} mouseEvent
*/
changeTabClick(mouseEvent) {
if (!mouseEvent.srcElement) {
if (!mouseEvent.target) {
return;
}
const tabNum = mouseEvent.srcElement.parentElement.getAttribute("inputNum");
const tabNum = mouseEvent.target.parentElement.getAttribute("inputNum");
if (tabNum) {
this.changeTab(parseInt(tabNum, 10), this.app.options.syncTabs);
}

View file

@ -511,8 +511,8 @@ class OutputWaiter {
* @param {event} mouseEvent
*/
changeTabClick(mouseEvent) {
if (!mouseEvent.srcElement) return;
const tabNum = mouseEvent.srcElement.parentElement.getAttribute("inputNum");
if (!mouseEvent.target) return;
const tabNum = mouseEvent.target.parentElement.getAttribute("inputNum");
if (tabNum) {
this.changeTab(parseInt(tabNum, 10), this.app.options.syncTabs);
}