summaryrefslogtreecommitdiff
path: root/ext/js/data/anki-note-data-creator.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-04-28 21:57:49 -0400
committerGitHub <noreply@github.com>2021-04-28 21:57:49 -0400
commit40b29cb0d3ff90094c44dd4cb7abd087a0fd9598 (patch)
tree0723d8cf5c61ffe091a150b9c9a1d2281f7d72a0 /ext/js/data/anki-note-data-creator.js
parent512391346bd4f67b1933b768c64d4dac1b58b44d (diff)
Add pitch categories template helper (#1636)
* Move utility function * Expose dictionary entry as a hidden property for internal use * Add pitchCategories helper
Diffstat (limited to 'ext/js/data/anki-note-data-creator.js')
-rw-r--r--ext/js/data/anki-note-data-creator.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/js/data/anki-note-data-creator.js b/ext/js/data/anki-note-data-creator.js
index f4d6ab49..3046a92e 100644
--- a/ext/js/data/anki-note-data-creator.js
+++ b/ext/js/data/anki-note-data-creator.js
@@ -53,7 +53,7 @@ class AnkiNoteDataCreator {
const context2 = this.createCachedValue(this._getPublicContext.bind(this, context));
const pitches = this.createCachedValue(this._getPitches.bind(this, dictionaryEntry));
const pitchCount = this.createCachedValue(this._getPitchCount.bind(this, pitches));
- return {
+ const result = {
marker,
get definition() { return self.getCachedValue(definition); },
glossaryLayoutMode,
@@ -70,6 +70,13 @@ class AnkiNoteDataCreator {
get pitchCount() { return self.getCachedValue(pitchCount); },
get context() { return self.getCachedValue(context2); }
};
+ Object.defineProperty(result, 'dictionaryEntry', {
+ configurable: false,
+ enumerable: false,
+ writable: false,
+ value: dictionaryEntry
+ });
+ return result;
}
/**