Bläddra i källkod

Update index.html

star7th 5 år sedan
förälder
incheckning
9b7bf02f72
1 ändrade filer med 4 tillägg och 5 borttagningar
  1. 4 5
      web_src/index.html

+ 4 - 5
web_src/index.html

@@ -31,14 +31,13 @@
     ///宽度变化大于50像素的时候刷新整个窗口以适应新宽度
     if ( Math.abs(Wwidth - window.innerWidth) > 50 ) {
         //console.log(window.innerWidth + ' ' + window.innerHeight);
-        //如果存在save-page,则保存内容后再刷新以免丢失内容
-        if(document.getElementById("save-page")){
-          document.getElementById("save-page").click();
+        //如果不在编辑页面,则在窗口变化后刷新窗口以适应宽度
+        if(window.location.href.indexOf("/edit") === -1){
+          window.location.reload();
         }
-        window.location.reload();
     };
 
   });
 
 
-</script>
+</script>