Browse Source

输入框遮挡

xuzhiheng 5 years ago
parent
commit
cef066bd33

+ 8 - 0
src/jfw/modules/app/src/web/staticres/jyapp/dataExport/js/additionWord.js

@@ -35,6 +35,14 @@ $(function(){
         this.style.height = this.scrollHeight + "px";
     });
 
+    //防止键盘把当前输入框给挡住
+    $('input[type="text"],textarea').focus(function () {
+        var target = this;
+        setTimeout(function(){
+            target.scrollIntoViewIfNeeded();
+        },400);
+    });
+
     // 添加keyWords检查输入框内是否有文字,如果有才能点击添加按钮
     $('.addkeyWord input.enterOne').on('input', function() {
 

+ 8 - 0
src/jfw/modules/app/src/web/staticres/jyapp/dataExport/js/keyWord.js

@@ -58,6 +58,14 @@ $(function(){
         this.style.height = this.scrollHeight + "px";
     });
 
+    //防止键盘把当前输入框给挡住
+    $('input[type="text"],textarea').focus(function () {
+        var target = this;
+        setTimeout(function(){
+            target.scrollIntoViewIfNeeded();
+        },400);
+    });
+
     // 添加 按钮的点击事件
     $('.addkeyWord .btn .save').on('click', function(){
         var keyWord = $('.addkeyWord input.enterOne').val();

+ 8 - 0
src/jfw/modules/app/src/web/templates/dataExport/dataExport_appended.html

@@ -425,6 +425,14 @@
             history.back();
         });
 
+        //防止键盘把当前输入框给挡住
+        $('input[type="text"],textarea').focus(function () {
+            var target = this;
+            setTimeout(function(){
+                target.scrollIntoViewIfNeeded();
+            },400);
+        });
+
     </script>
 </body>
 

+ 8 - 0
src/jfw/modules/app/src/web/templates/dataExport/dataExport_exclude.html

@@ -243,6 +243,14 @@
                 this.style.height = this.scrollHeight + "px";
             });
 
+            //防止键盘把当前输入框给挡住
+            $('input[type="text"],textarea').focus(function () {
+                var target = this;
+                setTimeout(function(){
+                    target.scrollIntoViewIfNeeded();
+                },400);
+            });
+
             // 添加keyWords检查输入框内是否有文字,如果有才能点击添加按钮
             $('.addkeyWord input.enterOne').on('input', function() {
 

+ 8 - 0
src/jfw/modules/app/src/web/templates/dataExport/dataExport_winnerEdit.html

@@ -153,6 +153,14 @@
 				this.style.height = this.scrollHeight + "px";
 			});
 
+			//防止键盘把当前输入框给挡住
+			$('input[type="text"],textarea').focus(function () {
+				var target = this;
+				setTimeout(function(){
+					target.scrollIntoViewIfNeeded();
+				},400);
+			});
+
 			// 添加keyWords检查输入框内是否有文字,如果有才能点击添加按钮
 			$('.addkeyWord input.enterOne').on('input', function() {
 

+ 8 - 0
src/web/staticres/wx_dataExport/js/additionWord.js

@@ -35,6 +35,14 @@ $(function(){
         this.style.height = this.scrollHeight + "px";
     });
 
+    //防止键盘把当前输入框给挡住
+    $('input[type="text"],textarea').focus(function () {
+        var target = this;
+        setTimeout(function(){
+            target.scrollIntoViewIfNeeded();
+        },400);
+    });
+
     // 添加keyWords检查输入框内是否有文字,如果有才能点击添加按钮
     $('.addkeyWord input.enterOne').on('input', function() {
 

+ 10 - 2
src/web/staticres/wx_dataExport/js/keyWord.js

@@ -27,7 +27,7 @@ $(function(){
     //添加按钮
     $(".addKeyWord i").on('click',function(){
         sessionStorage.removeItem("keyWord");
-        window.location.href="/jyapp/front/dataExport/keyWordInput";
+        window.location.href="/front/wx_dataExport/keyWordInput";
     });
 
     // 添加keyWords检查输入框内是否有文字,如果有才能点击添加按钮
@@ -234,7 +234,6 @@ $(function(){
         let oSpan = e.target.parentNode.nextElementSibling.children[0];
         let val = $(oSpan).val();
 
-        // alert(oSpan.documentElement.scrollTop)
         var keyWord = $(this).prev().children().find(".key").text();
         for(var i in keyWordArr){
             if(keyWordArr[i].keyWord === keyWord){
@@ -269,6 +268,15 @@ $(function(){
         $(oSpan).val('').focus().val(val);
         $(".addKeyWord").hide();
     });
+    //
+    //防止键盘把当前输入框给挡住
+    $('input[type="text"],textarea').focus(function () {
+        var target = this;
+        setTimeout(function(){
+            target.scrollIntoViewIfNeeded();
+        },400);
+    });
+
 
     // 编辑删除
     $('.showKeyWord').on('click', '.deleteKey', function(e) {

+ 8 - 0
src/web/templates/weixin/dataExport/dataExport_appended.html

@@ -215,6 +215,14 @@
                 this.style.height = this.scrollHeight + "px";
             });
 
+            //防止键盘把当前输入框给挡住
+            $('input[type="text"],textarea').focus(function () {
+                var target = this;
+                setTimeout(function(){
+                    target.scrollIntoViewIfNeeded();
+                },400);
+            });
+
             // 添加keyWords检查输入框内是否有文字,如果有才能点击添加按钮
             $('.addkeyWord input.enterOne').on('input', function() {
 

+ 8 - 0
src/web/templates/weixin/dataExport/dataExport_exclude.html

@@ -228,6 +228,14 @@
                 }
             });
 
+            //防止键盘把当前输入框给挡住
+            $('input[type="text"],textarea').focus(function () {
+                var target = this;
+                setTimeout(function(){
+                    target.scrollIntoViewIfNeeded();
+                },400);
+            });
+
             // 添加 按钮的点击事件
             $('.addkeyWord .btn .save').on('click', function(){
                 var exclude = $('.addkeyWord input.enterOne').val();

+ 1 - 1
src/web/templates/weixin/dataExport/dataExport_keyWord.html

@@ -110,7 +110,7 @@
     </div>
     <script src="{{Msg "seo" "cdn"}}/wx_dataExport/js/zepto.js?v={{Msg "seo" "version"}}"></script>
     <script src="{{Msg "seo" "cdn"}}/wx_dataExport/js/weui.min.js?v={{Msg "seo" "version"}}"></script>
-    <script src="{{Msg "seo" "cdn"}}/wx_dataExport/js/keyWord.js?v={{Msg "seo" "version"}}55"></script>
+    <script src="{{Msg "seo" "cdn"}}/wx_dataExport/js/keyWord.js?v={{Msg "seo" "version"}}63"></script>
     <script>
         initShare({{.T.signature}},{{.T.openid}},2,"jy_wxmyorder",{{.T.nickname}},{{.T.avatar}});
         $(window).bind("pageshow", function(event){

+ 8 - 0
src/web/templates/weixin/dataExport/dataExport_winnerEdit.html

@@ -138,6 +138,14 @@
 				}
 			});
 
+			//防止键盘把当前输入框给挡住
+			$('input[type="text"],textarea').focus(function () {
+				var target = this;
+				setTimeout(function(){
+					target.scrollIntoViewIfNeeded();
+				},400);
+			});
+
 			// 添加 按钮的点击事件
 			$('.addkeyWord .btn .save-btn').on('click', function(){
 				var keyWord = $('.addkeyWord input.enterOne').val();