]> _ Git - fluidbook-toolbox.git/commitdiff
wait #7574 @0:20
authorsoufiane <soufiane@cubedesigners.com>
Thu, 23 Oct 2025 16:15:23 +0000 (18:15 +0200)
committersoufiane <soufiane@cubedesigners.com>
Thu, 23 Oct 2025 16:15:23 +0000 (18:15 +0200)
resources/views/vendor/backpack/crud/form_content.blade.php

index b7dbb1467b2cd40b9c9c13e7d83b58090d18d180..795d25b5418872a3a7666faaa5b7b47ba23671bc 100644 (file)
             if (window.location.hash) {
                 $("input[name='_current_tab']").val(window.location.hash.substr(1));
             }
+
+            if($('[data-class="external_path_server_select"]').length > 0) {
+                function applyServerChange(s) {
+                    if (getInitialValue() !== $(s).val()) {
+                        $('a#s_section_downloads').addClass('non-default')
+                        $("[name=hidden_install_online]").val($(s).val())
+                    } else {
+                        $('a#s_section_downloads').removeClass('non-default')
+                        $("[name=hidden_install_online]").val(getInitialValue())
+                    }
+                }
+
+                function getInitialValue() {
+                    return $("[name=hidden_install_online]").attr('data-initial')
+                }
+
+                function setInitialValue() {
+                    $("[name=hidden_install_online]").attr('data-initial', $('[data-class="external_path_server_select"]').val())
+                }
+
+                setInitialValue()
+
+                $(document).on('change', '[data-class="external_path_server_select"]', function () {
+                    applyServerChange($(this));
+                });
+
+                $(document).on('keyup keydown', '[data-class="external_path_server_path"]', function () {
+                    applyServerChange($(this));
+                });
+            }
         });
     </script>