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