Browse Source

further fixed some exception checks

dev
Kyle 10 months ago
parent
commit
6614b19843
2 changed files with 8 additions and 8 deletions
  1. +4
    -4
      js/index.js
  2. +4
    -4
      js/options.js

+ 4
- 4
js/index.js View File

@@ -3,10 +3,10 @@ function restore_options() {
console.log("Loading Settings", result)
var quads = document.getElementsByClassName("quadrant")
var style = document.createElement("style")
if (! typeof result === "undefined") {
if (! typeof result.links) result.links = []
if (! typeof result.colors) result.colors = []
if (! typeof result.mode) result.mode = "light"
if (!(typeof result === 'undefined')) {
if (!(typeof result.links)) result.links = []
if (!(typeof result.colors)) result.colors = []
if (!(typeof result.mode)) result.mode = "light"
for (i = 0; i < quads.length; i++) {
if (i < result.links.length) {
var link = result.links[i]


+ 4
- 4
js/options.js View File

@@ -21,10 +21,10 @@ function restore_options() {
console.log("Loading Settings", result)
var input_links = document.querySelectorAll('input[type="text"]')
var input_colors = document.querySelectorAll('input[type="color"]')
if (! typeof result === "undefined") {
if (! typeof result.links) result.links = []
if (! typeof result.colors) result.colors = []
if (! typeof result.mode) result.mode = "light"
if (!(typeof result === 'undefined')) {
if (!(typeof result.links)) result.links = []
if (!(typeof result.colors)) result.colors = []
if (!(typeof result.mode)) result.mode = "light"
for (i = 0; i < input_links.length; i++) {
if (i < result.links.length) {
input_links[i].value = result.links[i]


Loading…
Cancel
Save