From e681533b0bd5fab1339d737115dc8f58f88aedb7 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Sat, 25 Mar 2023 21:05:34 +0400 Subject: [PATCH] Move title change out of a template function --- bundle.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bundle.js b/bundle.js index 4d078dc..667923f 100644 --- a/bundle.js +++ b/bundle.js @@ -14,7 +14,10 @@ window.leqsikoni = { $.getJSON( 'http://localhost:4567/words/' + word_id, - window.leqsikoni.words_xxxxx_template, + function(data) { + document.title = window.leqsikoni.maybe_text(data.primary_form) || '' + window.leqsikoni.words_xxxxx_template(data) + }, ) }, @@ -34,8 +37,6 @@ window.leqsikoni = { var examples = window.leqsikoni.words_xxxxx_examples_template(options.examples) - document.title = primary_form || '' - $('#primary-form').text(primary_form || '') $('#part-of-speech').text(part_of_speech || '') $('#commentary-data').text(commentary || '')