aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed/js/display.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-03-15 17:13:00 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-06 18:20:04 -0400
commit059db280bba858a3cab3a542aef13f19737aaf6e (patch)
tree31f8afe92ea57e63c8435f49114d790afad53b47 /ext/mixed/js/display.js
parent8b07a23de95ded3e6af93c78ab4f7f70cc449ea0 (diff)
Add custom context object for note creation
Diffstat (limited to 'ext/mixed/js/display.js')
-rw-r--r--ext/mixed/js/display.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index 8587657f..ecf92013 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -760,7 +760,7 @@ class Display {
}
}
- const noteId = await apiDefinitionAdd(definition, mode, details, this.getOptionsContext());
+ const noteId = await apiDefinitionAdd(definition, mode, this._getNoteContext(), details, this.getOptionsContext());
if (noteId) {
const index = this.definitions.indexOf(definition);
const adderButton = this.adderButtonFind(index, mode);
@@ -908,7 +908,7 @@ class Display {
async getDefinitionsAddable(definitions, modes) {
try {
- return await apiDefinitionsAddable(definitions, modes, this.getOptionsContext());
+ return await apiDefinitionsAddable(definitions, modes, this._getNoteContext(), this.getOptionsContext());
} catch (e) {
return [];
}
@@ -934,6 +934,10 @@ class Display {
return (typeof key === 'string' ? (key.length === 1 ? key.toUpperCase() : key) : '');
}
+ _getNoteContext() {
+ return {};
+ }
+
async _getAudioUri(definition, source) {
const optionsContext = this.getOptionsContext();
return await apiAudioGetUri(definition, source, optionsContext);