Skip to content

Commit

Permalink
Add MRU sort settings #36
Browse files Browse the repository at this point in the history
  • Loading branch information
reblws committed Dec 2, 2017
1 parent b41f7d7 commit e82725b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/pages/settings/input-bindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const d = document;
const disableBindings = {
showRecentlyClosed: ['recentlyClosedLimit', 'alwaysShowRecentlyClosedAtTheBottom'],
enableFuzzySearch: ['threshold', 'shouldSort'],
shouldSortByMostRecentlyUsedOnPopup: ['shouldSortByMostRecentlyUsedAll'],
};
const mirrorBindings = {
threshold: 'thresholdDisplay',
Expand All @@ -31,11 +32,11 @@ export default function addInputBindings() {
const dependents = disableBindings[masterId];
dependents.forEach((dependentId) => {
const dependent = d.getElementById(dependentId);
// Don't need strict compare
// eslint-disable-next-line eqeqeq
dependent.disabled = !checked;
const label = d.querySelector(`label[for=${dependentId}]`);
if (!checked) {
dependent.checked = false;
dependent.dispatchEvent(new Event('change'));
label.classList.add('disabled-label');
} else {
label.classList.remove('disabled-label');
Expand Down
2 changes: 2 additions & 0 deletions src/core/reducers/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export const initialGeneralSettings = {
recentlyClosedLimit: 5,
useFallbackFont: false,
showLastQueryOnPopup: false,
shouldSortByMostRecentlyUsedOnPopup: false,
shouldSortByMostRecentlyUsedAll: false,
};

export const initialState = {
Expand Down
12 changes: 12 additions & 0 deletions src/static/settings/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,18 @@ <h2>Search Results</h2>
Show the last query's results when opening the popup window
</label>
</p>
<p class="inputs">
<input type="checkbox" name="shouldSortByMostRecentlyUsedOnPopup" id="shouldSortByMostRecentlyUsedOnPopup">
<label for="shouldSortByMostRecentlyUsedOnPopup">
Sort tabs by most recently used (MRU) on popup
</label>
</p>
<p class="inputs">
<input type="checkbox" name="shouldSortByMostRecentlyUsedAll" id="shouldSortByMostRecentlyUsedAll">
<label for="shouldSortByMostRecentlyUsedAll">
<em>Always</em> sort tabs by most recently used (MRU)
</label>
</p>
</fieldset>
<fieldset>
<legend>
Expand Down

0 comments on commit e82725b

Please sign in to comment.