Bläddra i källkod

210922 replace space with  

yukyo0821 3 år sedan
förälder
incheckning
b9151f5747
1 ändrade filer med 6 tillägg och 6 borttagningar
  1. 6 6
      backstage/static/js/yo.js

+ 6 - 6
backstage/static/js/yo.js

@@ -634,23 +634,23 @@ function GenProductSection(mimg, specimg) {
     if ($("#swfPrice").val() != "")
         tmpstr = tmpstr.replaceAll('##swfPrice##', "<div>定價 : " + $("#swfPrice").val() + "</div>");
     else
-        tmpstr = tmpstr.replaceAll('##swfPrice##', "");
+        tmpstr = tmpstr.replaceAll('##swfPrice##', '&nbsp;');
     if ($("#swfColor").val() != "")
         tmpstr = tmpstr.replaceAll('##swfColor##', "<div>顏色 : " + $("#swfColor").val() + "</div>");
     else
-        tmpstr = tmpstr.replaceAll('##swfColor##', "");
+        tmpstr = tmpstr.replaceAll('##swfColor##', '&nbsp;');
     if ($("#swfSize").val() != "")
         tmpstr = tmpstr.replaceAll('##swfSize##', "<div>尺寸(mm) : " + $("#swfSize").val() + "</div>");
     else
-        tmpstr = tmpstr.replaceAll('##swfSize##', "");
+        tmpstr = tmpstr.replaceAll('##swfSize##', '&nbsp;');
     if ($("#swfMat").val() != "")
         tmpstr = tmpstr.replaceAll('##swfMat##', "<div>材質 : " + $("#swfMat").val() + "</div>");
     else
-        tmpstr = tmpstr.replaceAll('##swfMat##', "");
+        tmpstr = tmpstr.replaceAll('##swfMat##', '&nbsp;');
     if ($("#swfMemo").val() != "")
         tmpstr = tmpstr.replaceAll('##swfMemo##', "<div>備註 : " + $("#swfMemo").val() + "</div>");
     else
-        tmpstr = tmpstr.replaceAll('##swfMemo##', "");
+        tmpstr = tmpstr.replaceAll('##swfMemo##', '&nbsp;');
 
     mimgstr = "";
     firstimg = true;
@@ -703,7 +703,7 @@ function GenProductSection(mimg, specimg) {
                 + '"\n  layout="responsive">\n</amp-img>';
         }
     }
-    tmpstr = tmpstr.replaceAll('##SPEC-IMG##', specimgstr);
+    tmpstr = tmpstr.replaceAll('##SPEC-IMG##', specimgstr == "" ? "&nbsp;" : specimgstr);
 
     return tmpstr;