From c84556845a084056638a11e27b48ee29438c732c Mon Sep 17 00:00:00 2001 From: Philip Rogers Date: Thu, 3 Mar 2016 20:02:04 -0800 Subject: [PATCH] Remove caching of nodes in local variables with the same name as the node id which throws a ReferenceError in the stock android browser with use strict (https://pr.gg/androidStockBrowserUseStrictBug.html) --- index.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/index.js b/index.js index bf9669c..433092c 100644 --- a/index.js +++ b/index.js @@ -2,10 +2,6 @@ // Business logic for base64 encoder (index.html). // Requires asyncToBase64 and asyncFromBase64 from base64.js -// Cached DOM lookups, initialized in DOMContentLoaded. -var leftImageArea, leftTextarea, leftImageInput, leftTypeSelect, leftTypeText; -var rightTextarea, rightTypeSelect, rightTypeText; - // Initialization of these conversion type constants and locals is done in DOMContentLoaded. var LeftConversionTypes, RightConversionTypes; @@ -35,15 +31,6 @@ window.addEventListener('DOMContentLoaded', function() { leftConversionType = LeftConversionTypes[Object.keys(LeftConversionTypes)[0]]; rightConversionType = RightConversionTypes[Object.keys(RightConversionTypes)[0]]; - leftImageArea = document.getElementById('leftImageArea'); - leftTextarea = document.getElementById('leftTextarea'); - leftImageInput = document.getElementById('leftImageInput'); - leftTypeSelect = document.getElementById('leftTypeSelect'); - leftTypeText = document.getElementById('leftTypeText'); - rightTextarea = document.getElementById('rightTextarea'); - rightTypeSelect = document.getElementById('rightTypeSelect'); - rightTypeText = document.getElementById('rightTypeText'); - leftTextarea.addEventListener('input', function() { userLastChangedRightSide = false; updateConversion(); @@ -86,7 +73,6 @@ window.addEventListener('DOMContentLoaded', function() { // Drag and drop support. var insideCount = 0; - var leftContent = document.getElementById('leftContent'); leftContent.addEventListener('dragenter', function(event) { insideCount++; leftTextarea.classList.add('dragover');