]> git.mxchange.org Git - friendica.git/commitdiff
I will not share options that are not being used.
authorJeroen De Meerleer <me@jeroened.be>
Fri, 22 Feb 2019 13:13:07 +0000 (14:13 +0100)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 23 Mar 2019 02:28:10 +0000 (22:28 -0400)
view/theme/frio/templates/theme_settings.tpl

index eaa71d3fe1dc3cae9b6077ba00dc8cb688a7a349..656d8dee84dc46adf882587fa925eab6b8b672f8 100644 (file)
                        if ($("#id_frio_background_image").length) {
                                theme.background_image = $("#id_frio_background_image").val();
 
-                               var elText = theme.background_image;
-
-                               if ($("#id_frio_bg_image_option_stretch").is(":checked") == true) {
-                                   theme.background_image_option = "stretch";
-                               }
-                               if ($("#id_frio_bg_image_option_cover").is(":checked") == true) {
-                                   theme.background_image_option = "cover";
-                               }
-                               if ($("#id_frio_bg_image_option_contain").is(":checked") == true) {
-                                   theme.background_image_option = "contain";
-                               }
-                               if ($("#id_frio_bg_image_option_repeat").is(":checked") == true) {
-                                   theme.background_image_option = "repeat";
-                               }
+                               if (theme.background_image.length > 0) {
+                                       if ($("#id_frio_bg_image_option_stretch").is(":checked") == true) {
+                                               theme.background_image_option = "stretch";
+                                       }
+                                       if ($("#id_frio_bg_image_option_cover").is(":checked") == true) {
+                                               theme.background_image_option = "cover";
+                                       }
+                                       if ($("#id_frio_bg_image_option_contain").is(":checked") == true) {
+                                               theme.background_image_option = "contain";
+                                       }
+                                       if ($("#id_frio_bg_image_option_repeat").is(":checked") == true) {
+                                               theme.background_image_option = "repeat";
+                                       }
+                                }
                        }
 
                        if ($("#frio_contentbg_transp").length) {
                                var elText = theme.background_image;
                                if(elText.length !== 0) {
                                        $("#frio_bg_image_options").show();
-                           } else {
-                                   $("#frio_bg_image_options").hide();
-                           }
+                               } else {
+                                       $("#frio_bg_image_options").hide();
+                               }
 
                                switch (theme.background_image_option) {
-                                   case 'stretch':
-                                       $("#id_frio_bg_image_option_stretch").prop("checked", true);
-                                       break;
-                                   case 'cover':
-                                       $("#id_frio_bg_image_option_cover").prop("checked", true);
-                                       break;
-                                   case 'contain':
-                                       $("#id_frio_bg_image_option_contain").prop("checked", true);
-                                       break;
-                                   case 'repeat':
-                                       $("#id_frio_bg_image_option_repeat").prop("checked", true);
-                                       break;
+                                       case 'stretch':
+                                               $("#id_frio_bg_image_option_stretch").prop("checked", true);
+                                               break;
+                                       case 'cover':
+                                               $("#id_frio_bg_image_option_cover").prop("checked", true);
+                                               break;
+                                       case 'contain':
+                                               $("#id_frio_bg_image_option_contain").prop("checked", true);
+                                               break;
+                                       case 'repeat':
+                                               $("#id_frio_bg_image_option_repeat").prop("checked", true);
+                                               break;
                                }
                        }