Skip to content

Commit

Permalink
Merge pull request #161 from WesleyBranton/development
Browse files Browse the repository at this point in the history
Pre-release bug fixes
  • Loading branch information
WesleyBranton authored Jul 27, 2022
2 parents 9ab6e1f + 216b6b3 commit c967cb3
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
6 changes: 1 addition & 5 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,13 @@ function handleInstalled(details) {
} else if (details.reason == 'update') {
browser.storage.local.get(["unsubscribedFromAllUpdateNotifications"], (data) => {
if (!data.unsubscribedFromAllUpdateNotifications) {
const currentVersionHasUpdateNotice = false;
const currentVersionHasUpdateNotice = true;
const currentVersion = browser.runtime.getManifest().version;
let updatePage = null;

if (currentVersionHasUpdateNotice && compareVersionNumbers(details.previousVersion, currentVersion) == 2) {
const version = parseVersion(currentVersion);
updatePage = `v${version.major}_${version.minor}${(version.patch > 0) ? `_${version.patch}` : ''}`;
} else if (compareVersionNumbers(details.previousVersion, "3.1.1") == 0 && runningOn == browsers.FIREFOX) {
updatePage = 'v3_1_2';
} else if (compareVersionNumbers(details.previousVersion, "3.0") == 2) {
updatePage = 'v3_0';
}

if (updatePage != null) {
Expand Down
10 changes: 6 additions & 4 deletions src/generateCSS.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ function generateCSS(width, colorTrack, colorThumb, override, customWidth, butto
const thumbNoHover = new CSSRule(':not(body):not(:hover):not(focus)::-webkit-scrollbar-thumb');
thumbNoHover.set('background', 'transparent', true);
css.push(thumbNoHover);

thumb.set('transition', 'ease 0.3s background', false);
}

if (thumbRadius > 0) {
Expand All @@ -104,8 +102,6 @@ function generateCSS(width, colorTrack, colorThumb, override, customWidth, butto
const trackNoHover = new CSSRule(':not(body):not(:hover):not(focus)::-webkit-scrollbar-track');
trackNoHover.set('background', 'transparent', true);
css.push(trackNoHover);

track.set('transition', 'ease 0.3s background', false);
}

css.push(track);
Expand All @@ -126,6 +122,12 @@ function generateCSS(width, colorTrack, colorThumb, override, customWidth, butto
button.set('height', width, overrideWidth);
css.push(button);

if (autoHide) {
const buttonNoHover = new CSSRule(':not(body):not(:hover):not(focus)::-webkit-scrollbar-button');
buttonNoHover.set('display', 'none', true);
css.push(buttonNoHover);
}

const buttonHover = new CSSRule('::-webkit-scrollbar-button:hover');
buttonHover.set('background-color', changeBrightness(colorThumb, 10 * brightFactor), overrideColor);
css.push(buttonHover);
Expand Down
5 changes: 3 additions & 2 deletions src/options/scripts/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ function saveScrollbar() {

const wrapper = {};
wrapper[`profile_${selectedProfile}`] = profileData;
ignoreNextChange = true;

browser.storage.local.set(wrapper, () => {
showProgressBar(false);
toggleChangesWarning(false);
reloadProfileSelection(document.settings.profile, updateSelectedProfileInDropdown);
ignoreNextChange = true;
unloadedChanges = false;
});
},
Expand Down Expand Up @@ -670,7 +670,8 @@ function updateSelectedProfileInDropdown() {
switch (profile.width) {
case 'auto':
case 'unset':
widthOutput.textContent = browser.i18n.getMessage('sizeWide');
const key = (runningOn == browsers.FIREFOX) ? 'sizeDefault' : 'sizeWide';
widthOutput.textContent = browser.i18n.getMessage(key);
break;
case 'thin':
widthOutput.textContent = browser.i18n.getMessage('sizeThin');
Expand Down
10 changes: 7 additions & 3 deletions src/options/scripts/rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ function saveRules() {
rules: temp
};

ignoreNextChange = true;
browser.storage.local.set(object, () => {
showProgressBar(false);
ignoreNextChange = true;
unloadedChanges = false;
});
toggleChangesWarning(false);
Expand Down Expand Up @@ -376,7 +376,10 @@ function triggerChangeProfile(item) {
const profileNameOutput = item.getElementsByClassName('rule-profile')[0];
rule.profile = `profile_${value}`;

if (listOfProfiles[rule.profile]) {
if (rule.profile == 'profile_none') {
profileNameOutput.textContent = browser.i18n.getMessage('profileUsingNone');
profileNameOutput.classList.remove('profile-missing');
} else if (listOfProfiles[rule.profile]) {
profileNameOutput.textContent = listOfProfiles[rule.profile];
profileNameOutput.classList.remove('profile-missing');
} else {
Expand Down Expand Up @@ -639,7 +642,8 @@ function clear() {
switch (profile.width) {
case 'auto':
case 'unset':
widthOutput.textContent = browser.i18n.getMessage('sizeWide');
const key = (runningOn == browsers.FIREFOX) ? 'sizeDefault' : 'sizeWide';
widthOutput.textContent = browser.i18n.getMessage(key);
break;
case 'thin':
widthOutput.textContent = browser.i18n.getMessage('sizeThin');
Expand Down
4 changes: 3 additions & 1 deletion src/popup/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ function loadProfile(id) {
detailsContainer.classList.add('dim');

widthOutput.textContent = '-';
autoHideOutput.textContent = '-';
buttonsOutput.textContent = '-';
thumbRadiusOutput.textContent = '-';
overrideOutput.textContent = '-';
Expand All @@ -256,7 +257,8 @@ function loadProfile(id) {
switch (profile.width) {
case 'auto':
case 'unset':
widthOutput.textContent = browser.i18n.getMessage('sizeWide');
const key = (runningOn == browsers.FIREFOX) ? 'sizeDefault' : 'sizeWide';
widthOutput.textContent = browser.i18n.getMessage(key);
break;
case 'thin':
widthOutput.textContent = browser.i18n.getMessage('sizeThin');
Expand Down

0 comments on commit c967cb3

Please sign in to comment.