]> git.mxchange.org Git - friendica.git/commitdiff
[frio] Fix jS error that was preventing further script execution in theme settings
authorHypolite Petovan <hypolite@mrpetovan.com>
Tue, 18 Apr 2023 01:26:12 +0000 (21:26 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 18 Apr 2023 01:26:12 +0000 (21:26 -0400)
- $("#id_frio_background_image").val() was undefined when showing accents

view/theme/frio/templates/theme_settings.tpl

index 7d47f46e2b4472887e3b1639a31d1edf4677fead..d633913edfbfe3e523c1b20910c03d8601d1912b 100644 (file)
                // Create colorpickers
                $("#frio_nav_bg, #frio_nav_icon_color, #frio_background_color, #frio_link_color, #frio_login_bg_color").colorpicker({format: 'hex', align: 'left'});
 
-               // show image options when user starts to type the address of the image
-               $("#id_frio_background_image").keyup(function(){
-                       var elText = $(this).val();
-                       if(elText.length !== 0) {
-                               $("#frio_bg_image_options").show();
-                       } else {
-                               $("#frio_bg_image_options").hide();
-                       }
-               });
+               if ($("#id_frio_background_image").length) {
+                       // show image options when user starts to type the address of the image
+                       $("#id_frio_background_image").keyup(function () {
+                               const elText = $(this).val();
+                               if (elText.length !== 0) {
+                                       $("#frio_bg_image_options").show();
+                               } else {
+                                       $("#frio_bg_image_options").hide();
+                               }
+                       });
 
-               // show the image options if there is already an image
-               if($("#id_frio_background_image").val().length != 0) {
+                       // show the image options if there is already an image
+                       if ($("#id_frio_background_image").val().length != 0) {
                                $("#frio_bg_image_options").show();
+                       }
                }
        });
 </script>