wangchuanjin 9 жил өмнө
parent
commit
39f45120f2

+ 28 - 2
core/src/web/staticres/wxswordfish/main.js

@@ -103,9 +103,10 @@ function _KeyFocus(objn){
 	//alert(dialogTop+"="+parentObj.height()+"="+obj.offset().top+"="+parentObj[0].offsetHeight+"="+parentObj[0].scrollHeight+"="+parentObj[0].scrollTop)
 }
 //
+var adjustmentFlag = false;
 var FOCUS
 function setFocus(obj){
-	if(!FOCUS){
+	if(!focus){
 		FOCUS=$(obj)
 		var parentObj=FOCUS.closest(".dialog-content");
 		parentObj.unbind("resizeblock").bind("resizeblock",function(){
@@ -113,12 +114,35 @@ function setFocus(obj){
 				parentObj.unbind("resizeblock");
 		})	
 	}
+	var isiOS = !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
+	if(!isiOS){
+		setTimeout(function(){
+			if(winHeight == window.innerHeight){
+				adjustmentFlag = true;
+				$(obj).parents(".dialog-main").css({top: "20px",height: "193px"});
+				$(obj).parents(".dialog-content").css({height: "121px"});
+			}
+			var thisParent = $(obj).parents(".keyWordGroup");
+			var thisIndex = parseInt(thisParent.children("lable").children("font").text());
+			if($(obj).parents(".dialog-content").height() / thisParent.height() < thisIndex){
+				$(obj).closest(".dialog-content").scrollTop((thisIndex-1) * thisParent.height() + (thisIndex - 2) * 10);
+			}
+		},500);
+	}
+}
+function setBlur(obj){
+	setTimeout(function(){
+		if(adjustmentFlag){
+			$(obj).parents(".dialog-main").css({top: "auto",height: "auto"});
+		}
+	},500);
+	
 }
 KeyWordDialog.AppendNode = function(dialogObj,value){
 	var getHtml = function(index,value){
 		return '<div class="keyWordGroup">'
 					+'<lable style="white-space:nowrap;">关键词<font>'+index+'</font></lable>'
-					+'<div><input type="text" onfocus="setFocus(this)" value="'+(value?value:"")+'" placeholder="示例:税务局 软件" maxlength="100"></div>'
+					+'<div><input type="text" onfocus="setFocus(this)" onblur="setBlur(this)" value="'+(value?value:"")+'" placeholder="示例:税务局 软件" maxlength="100"></div>'
 					+'<div><img src="/wxswordfish/images/delete.png" class="delete"'+(index==1?' style="display: none;"':'')+'></div>'
 				+'</div>';
 	}
@@ -459,8 +483,10 @@ function commonAjaxReq(object,module){
 	});
 }
 var winWidth=300;
+var winHeight=0;
 $(function(){
 	winWidth=$(window).width();
+	winHeight=$(window).height();
 	var turnOn = function(obj){
 		obj.addClass("open");
 		var liobj = obj.parents("li");

+ 1 - 1
core/src/web/staticres/wxswordfish/style.css

@@ -206,7 +206,7 @@ img{
 	display: table;
 	width: 100%;
 	height: 50px;
-	line-height: 40px;
+	line-height: 50px;
 	margin-bottom: 10px;
 }
 .keyword-dialog .dialog-content>div>*{