From f3cf4d10c711037c99c185dd0b46dac9f5d69794 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Tue, 18 May 2021 17:41:27 -0400 Subject: Dictionary image display refactoring (#1687) * Generalize image definition generation * Enable optional aspect ratio * Move styles * Update styles * Add more options for collapsing images * Add image options for collapsing * Improve layout for images that are collapsed --- ext/js/language/dictionary-importer.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'ext/js/language') diff --git a/ext/js/language/dictionary-importer.js b/ext/js/language/dictionary-importer.js index e060b3b1..051375a0 100644 --- a/ext/js/language/dictionary-importer.js +++ b/ext/js/language/dictionary-importer.js @@ -306,10 +306,8 @@ class DictionaryImporter { } async _formatDictionaryTermGlossaryImage(data, context, entry) { - const {path, width: preferredWidth, height: preferredHeight, title, description, pixelated} = data; + const {path, width: preferredWidth, height: preferredHeight, title, description, pixelated, collapsed, collapsible} = data; const {width, height} = await this._getImageMedia(path, context, entry); - - // Create new data const newData = { type: 'image', path, @@ -321,7 +319,8 @@ class DictionaryImporter { if (typeof title === 'string') { newData.title = title; } if (typeof description === 'string') { newData.description = description; } if (typeof pixelated === 'boolean') { newData.pixelated = pixelated; } - + if (typeof collapsed === 'boolean') { newData.collapsed = collapsed; } + if (typeof collapsible === 'boolean') { newData.collapsible = collapsible; } return newData; } -- cgit v1.2.3