]> _ Git - fluidbook-toolbox.git/commitdiff
wait #5644 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 14 Dec 2022 13:40:43 +0000 (14:40 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 14 Dec 2022 13:40:43 +0000 (14:40 +0100)
resources/linkeditor/js/linkeditor.form.js

index 85521524e82794f5cf9bd9cf5907a123de6b2f01..bf882ce98f1e0deb27942db5101edf164daeb03d 100644 (file)
@@ -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 () {