Merge branch 'weixin_guange' of https://git.trustie.net/jacknudt/trustieforge into weixin_guange

weixin_guange
yuanke 9 years ago
commit 589df7e498

@ -1,24 +1,28 @@
/** /**
* Created by ttang on 2016/8/22. * Created by ttang on 2016/8/22.
*/ */
app.directive('iphoneRecognize',function(){ app.directive('iphoneRecognize',["$timeout",function(timer){
return{ return{
restrict: 'A', restrict: 'A',
scope: {}, scope: {},
link: function(scope, element){ link: function(scope, element){
var userAgent = navigator.userAgent; timer(function(){
var userAgent = navigator.userAgent;
var contentHeight = $(".post-container").height();
if (/ipad|iphone|mac/i.test(navigator.userAgent)){ if (/ipad|iphone|mac/i.test(navigator.userAgent)){
$("#postInput1").bind('focus',function(){ $("#postInput1").bind('focus',function(){
element.css({"position":"relative","padding":"1px 0"}); element.css({"position":"relative","padding":"1px 0"});
$(".post-wrapper").css("margin-bottom","0"); $(".post-wrapper").css("margin-bottom","0");
$("#all_homework_reply").css("margin-bottom","0"); $("#all_homework_reply").css("margin-bottom","0");
}); window.scrollTo(0,contentHeight);
$("#postInput1").bind('blur',function(){ });
element.css("position","fixed"); $("#postInput1").bind('blur',function(){
$(".post-wrapper").css("margin-bottom","10px"); element.css("position","fixed");
$("#all_homework_reply").css("margin-bottom","50px"); $(".post-wrapper").css("margin-bottom","10px");
}); $("#all_homework_reply").css("margin-bottom","50px");
});
} }
})
} }
} }
}); }]);
Loading…
Cancel
Save