client/tags: add ability to turn off suggestions
This commit is contained in:
parent
97b217dc31
commit
673bb52d4a
4 changed files with 11 additions and 0 deletions
|
@ -18,6 +18,9 @@
|
||||||
<li>
|
<li>
|
||||||
<%= ctx.makeCheckbox({text: 'Enable transparency grid', id: 'transparency-grid', name: 'transparency-grid', checked: ctx.browsingSettings.transparencyGrid}) %>
|
<%= ctx.makeCheckbox({text: 'Enable transparency grid', id: 'transparency-grid', name: 'transparency-grid', checked: ctx.browsingSettings.transparencyGrid}) %>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<%= ctx.makeCheckbox({text: 'Show tag suggestions', id: 'tag-suggestions', name: 'tag-suggestions', checked: ctx.browsingSettings.tagSuggestions}) %>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class='messages'></div>
|
<div class='messages'></div>
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
const api = require('../api.js');
|
const api = require('../api.js');
|
||||||
const tags = require('../tags.js');
|
const tags = require('../tags.js');
|
||||||
const misc = require('../util/misc.js');
|
const misc = require('../util/misc.js');
|
||||||
|
const settings = require('../models/settings.js');
|
||||||
const events = require('../events.js');
|
const events = require('../events.js');
|
||||||
const views = require('../util/views.js');
|
const views = require('../util/views.js');
|
||||||
const TagAutoCompleteControl = require('./tag_auto_complete_control.js');
|
const TagAutoCompleteControl = require('./tag_auto_complete_control.js');
|
||||||
|
@ -335,6 +336,10 @@ class TagInputControl extends events.EventTarget {
|
||||||
}
|
}
|
||||||
|
|
||||||
_loadSuggestions(tag) {
|
_loadSuggestions(tag) {
|
||||||
|
const browsingSettings = settings.get();
|
||||||
|
if (!browsingSettings.tagSuggestions) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
api.get('/tag-siblings/' + tag.names[0], {noProgress: true})
|
api.get('/tag-siblings/' + tag.names[0], {noProgress: true})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
return Promise.resolve(response.results);
|
return Promise.resolve(response.results);
|
||||||
|
|
|
@ -13,6 +13,7 @@ const defaultSettings = {
|
||||||
keyboardShortcuts: true,
|
keyboardShortcuts: true,
|
||||||
transparencyGrid: true,
|
transparencyGrid: true,
|
||||||
fitMode: 'fit-both',
|
fitMode: 'fit-both',
|
||||||
|
tagSuggestions: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
class Settings extends events.EventTarget {
|
class Settings extends events.EventTarget {
|
||||||
|
|
|
@ -39,6 +39,8 @@ class SettingsView extends events.EventTarget {
|
||||||
'#keyboard-shortcuts').checked,
|
'#keyboard-shortcuts').checked,
|
||||||
transparencyGrid: this._formNode.querySelector(
|
transparencyGrid: this._formNode.querySelector(
|
||||||
'#transparency-grid').checked,
|
'#transparency-grid').checked,
|
||||||
|
tagSuggestions: this._formNode.querySelector(
|
||||||
|
'#tag-suggestions').checked,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
Loading…
Reference in a new issue