From f8d86dd24517b693e7b7668e6b8cb9a701e470e9 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 14 Dec 2022 14:40:43 +0100 Subject: [PATCH] wait #5644 @0.5 --- resources/linkeditor/js/linkeditor.form.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/resources/linkeditor/js/linkeditor.form.js b/resources/linkeditor/js/linkeditor.form.js index 85521524e..bf882ce98 100644 --- a/resources/linkeditor/js/linkeditor.form.js +++ b/resources/linkeditor/js/linkeditor.form.js @@ -9,7 +9,8 @@ LinkeditorForm.prototype = { init: function () { var $this = this; - $('#linkeditor-panel-form').on('change', '[name="type"]', function () { + $(document).on('change', '#linkeditor-panel-form [name="type"]', function () { + console.log('change type'); if ($this._maskChangeEvent) { return; } @@ -17,7 +18,7 @@ LinkeditorForm.prototype = { $this.updateLinkForm(); }); - $('#linkeditor-panel-form').on('change', "input, select, textarea", function () { + $(document).on('change', "#linkeditor-panel-form input,#linkeditor-panel-form select,#linkeditor-panel-form textarea", function () { if ($this._maskChangeEvent) { return; } @@ -29,7 +30,6 @@ LinkeditorForm.prototype = { $(document).on('change', ".freefile-file-input", function () { var form = $('#linkupload').clone(); - var id = 'linkupload_' + Math.round(Math.random() * 10000000); $(form).attr('id', id); $(this).attr('form', id); @@ -44,6 +44,7 @@ LinkeditorForm.prototype = { tf.val(data[0]); tf.trigger('change'); $(parent).removeClass('loading'); + $this.saveFormDataInLink(); setTimeout(function () { $this.linkeditor.save.saveIfUnsavedChanges(TRANSLATIONS.upload_save_message, false, function () { @@ -52,8 +53,6 @@ LinkeditorForm.prototype = { }); }); - - }, saveFormDataInLink: function () { -- 2.39.5