aboutsummaryrefslogtreecommitdiffstats
path: root/ui/lib
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-08-30 08:34:29 +0800
committerDan Finlay <dan@danfinlay.com>2016-08-30 08:34:29 +0800
commitc15eef9425531c86a9016d1cbad9d32f4d12edcd (patch)
treededc156a42acb9419a7eba8decbcad98cc9cb59a /ui/lib
parente4e7489dd9085c4fa2cef9262bc683d605d26b50 (diff)
downloadtangerine-wallet-browser-c15eef9425531c86a9016d1cbad9d32f4d12edcd.tar
tangerine-wallet-browser-c15eef9425531c86a9016d1cbad9d32f4d12edcd.tar.gz
tangerine-wallet-browser-c15eef9425531c86a9016d1cbad9d32f4d12edcd.tar.bz2
tangerine-wallet-browser-c15eef9425531c86a9016d1cbad9d32f4d12edcd.tar.lz
tangerine-wallet-browser-c15eef9425531c86a9016d1cbad9d32f4d12edcd.tar.xz
tangerine-wallet-browser-c15eef9425531c86a9016d1cbad9d32f4d12edcd.tar.zst
tangerine-wallet-browser-c15eef9425531c86a9016d1cbad9d32f4d12edcd.zip
Make element enumeration Edge compatible
Diffstat (limited to 'ui/lib')
-rw-r--r--ui/lib/persistent-form.js17
1 files changed, 7 insertions, 10 deletions
diff --git a/ui/lib/persistent-form.js b/ui/lib/persistent-form.js
index c2bf99360..d4dc20b03 100644
--- a/ui/lib/persistent-form.js
+++ b/ui/lib/persistent-form.js
@@ -14,10 +14,9 @@ inherits(PersistentForm, Component)
PersistentForm.prototype.componentDidMount = function () {
const fields = document.querySelectorAll('[data-persistent-formid]')
const store = this.getPersistentStore()
- if (!fields) {
- return
- }
- fields.forEach((field) => {
+
+ for (var i = 0; i < fields.length; i++) {
+ const field = fields[i]
const key = field.getAttribute('data-persistent-formid')
const cached = store[key]
if (cached !== undefined) {
@@ -25,7 +24,7 @@ PersistentForm.prototype.componentDidMount = function () {
}
field.addEventListener(eventName, this.persistentFieldDidUpdate.bind(this))
- })
+ }
}
PersistentForm.prototype.getPersistentStore = function () {
@@ -53,12 +52,10 @@ PersistentForm.prototype.persistentFieldDidUpdate = function (event) {
PersistentForm.prototype.componentWillUnmount = function () {
const fields = document.querySelectorAll('[data-persistent-formid]')
- if (!fields) {
- return
- }
- fields.forEach((field) => {
+ for (var i = 0; i < fields.length; i++) {
+ const field = fields[i]
field.removeEventListener(eventName, this.persistentFieldDidUpdate.bind(this))
- })
+ }
this.setPersistentStore({})
}