Skip to content

Commit

Permalink
refactor: use util's onError() for #292
Browse files Browse the repository at this point in the history
  • Loading branch information
ffoodd committed May 9, 2019
1 parent 41c02c0 commit e7ef404
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 9 deletions.
Binary file modified a11ycss-webextension-chrome.zip
Binary file not shown.
Binary file modified a11ycss-webextension-firefox.zip
Binary file not shown.
5 changes: 1 addition & 4 deletions webextension/scripts/checkalts.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,11 @@ btnCheckalts.addEventListener('click', function () {
icons: icons,
strings: strings
});
}).catch(onError);
});
var checked = this.getAttribute('aria-checked') === 'true' || false;
this.setAttribute('aria-checked', !checked);
storeCheckAltsStatus(!checked);
});
function onError(error) {
console.error(`Error: ${error}`);
}

function checkAltsOnload() {
let getStatus = browser.storage.local.get("checkAltsStatus");
Expand Down
6 changes: 1 addition & 5 deletions webextension/scripts/textspacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,12 @@ btnTextspacing.addEventListener('click', function () {
browser.tabs.sendMessage(tabs[0].id, {
a11ycss_action: "textspacing"
});
}).catch(onError);
});
var checked = this.getAttribute('aria-checked') === 'true' || false;
this.setAttribute('aria-checked', !checked);
storeTextSpacingStatus(!checked);
});

function onError(error) {
console.error(`Error: ${error}`);
}

function textSpacingOnload() {
let getStatus = browser.storage.local.get("textSpacingStatus");
getStatus.then(
Expand Down
1 change: 1 addition & 0 deletions webextension/scripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function _t() {
function onError(error) {
console.error(`a11y.css error: ${error}`);
}

/**
* Documents what we got from a STORAGE.get()
* @param {Object} item
Expand Down

0 comments on commit e7ef404

Please sign in to comment.