Replaced the deprecated JavaScript String.substr with String.substring.
This commit is contained in:
		| @@ -75,7 +75,7 @@ function updateParent(code) { | |||||||
|         parent.text(gettext("Topmost")); |         parent.text(gettext("Topmost")); | ||||||
|         return; |         return; | ||||||
|     } |     } | ||||||
|     const parentCode = code.value.substr(0, code.value.length - 1); |     const parentCode = code.value.substring(0, code.value.length - 1); | ||||||
|     if (parentCode in accounts) { |     if (parentCode in accounts) { | ||||||
|         parent.text(parentCode + " " + accounts[parentCode]); |         parent.text(parentCode + " " + accounts[parentCode]); | ||||||
|         return; |         return; | ||||||
| @@ -136,7 +136,7 @@ function validateCode() { | |||||||
|             return false; |             return false; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|     const parentCode = code.value.substr(0, code.value.length - 1); |     const parentCode = code.value.substring(0, code.value.length - 1); | ||||||
|     if (!(parentCode in accounts)) { |     if (!(parentCode in accounts)) { | ||||||
|         code.classList.add("is-invalid"); |         code.classList.add("is-invalid"); | ||||||
|         errorMessage.text(gettext("The parent account of this code does not exist.")); |         errorMessage.text(gettext("The parent account of this code does not exist.")); | ||||||
|   | |||||||
| @@ -298,7 +298,7 @@ function parseSummaryForHelper(summary) { | |||||||
|     const pos = summary.lastIndexOf("×"); |     const pos = summary.lastIndexOf("×"); | ||||||
|     let count = 1; |     let count = 1; | ||||||
|     if (pos !== -1) { |     if (pos !== -1) { | ||||||
|         count = parseInt(summary.substr(pos + 1)); |         count = parseInt(summary.substring(pos + 1)); | ||||||
|     } |     } | ||||||
|     if (count === 0) { |     if (count === 0) { | ||||||
|         count = 1; |         count = 1; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user