]> _ Git - fluidbook-toolbox.git/commitdiff
wip #7868
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 30 Jan 2026 17:54:43 +0000 (18:54 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 30 Jan 2026 17:54:43 +0000 (18:54 +0100)
resources/linkeditor-stable/js/linkeditor.form.js

index d4fcf16c388eac7f4e7c296e4caff972adbb282e..3003d4d45157a42bd7eae7812c3237ed0d272285 100644 (file)
@@ -298,16 +298,18 @@ LinkeditorForm.prototype = {
 
     updateShortLinks: function () {
         let fto = $('#linkeditor-panel-form').find('[name="to"]');
-        console.log(fto);
         if (fto.length === 0) {
             return;
         }
         let val = $(fto).val();
         if (SHORTENED_LINKS[val] !== undefined) {
-            $(fto).after('<p class="help-block">' + TRANSLATIONS.short_link + ': <strong><a href="' + SHORTENED_LINKS[val] + '" target="_blank">' + SHORTENED_LINKS[val].replace('https://', '') + '</a></strong></p>');
+            if ($(fto).next('.help-block').length === 0) {
+                $(fto).after('<p class="help-block"></p>');
+            }
+            $(fto).next('.help-block').html(TRANSLATIONS.short_link + ': <strong><a href="' + SHORTENED_LINKS[val] + '" target="_blank">' + SHORTENED_LINKS[val].replace('https://', '') + '</a></strong>');
             $(fto).addClass('short');
         } else {
-            $(fto).next('.help-block').remove();
+            $(fto).next('.help-block').html('');
             $(fto).removeClass('short');
         }
     },