微信修改资料select框去边框;二级回复显隐点击效果更改

This commit is contained in:
Tim 2016-09-08 14:15:00 +08:00
parent 1109eba460
commit 216c834a40
4 changed files with 67 additions and 35 deletions

View File

@ -1,19 +1,40 @@
app.directive('inputAuto',function(){ //app.directive('inputAuto',function(){
// return{
// restrict: 'A',
// scope: {},
// link: function(scope, element){
// var copyContainer = element.parent().children().children().eq(0);
// var sendButton = element.next();
// element.on('input',function(){
// //console.log(sendButton);
// copyContainer.html(element[0].value);
// var textHeight = copyContainer[0].scrollHeight-10;
// element.css('height', textHeight + 'px');
// });
// sendButton.on('click',function(){
// element.css('height','18px');
// });
// }
// }
//});
app.directive('inputAuto',["$timeout",function(timer){
return{ return{
restrict: 'A', restrict: 'A',
scope: {}, scope: {},
link: function(scope, element){ link: function(scope, element){
var copyContainer = element.parent().children().children().eq(0); timer(function(){
var sendButton = element.next(); $(".post-reply-input").bind("input",function(){
element.on('input',function(){ var copyInput = $(this).prev().children();
//console.log(sendButton); var sendButton = $(this).next();
copyContainer.html(element[0].value); copyInput.html($(this).val());
var textHeight = copyContainer[0].scrollHeight-10; var textHeight = copyInput[0].scrollHeight-10;
element.css('height', textHeight + 'px'); $(this).css("height",textHeight + "px");
}); sendButton.click(function(){
sendButton.on('click',function(){ $(this).prev().css("height","18px");
element.css('height','18px'); })
});
}); });
} }
} }
}); }]);

View File

@ -7,23 +7,35 @@ app.directive('multiReply',["$timeout",function(timer){
scope: {}, scope: {},
link: function(scope, element){ link: function(scope, element){
timer(function(){ timer(function(){
$(".reply-icons").live("click",function(){ $(".reply-icons").each(function(){
if($(this).hasClass("multi-hide")){ $(this).toggle(function(){
$(".multi-input-container").addClass("undis");
$(".reply-icons").addClass("multi-hide");
$(this).next().next().removeClass("undis"); $(this).next().next().removeClass("undis");
$(this).next().next().focus(); $(this).next().next().focus();
$(this).removeClass("multi-hide"); },function(){
$(".post-reply-input").val(""); $(this).next().next().addClass("undis");
$("#post_input_1").hide(); });
}
else{
$(this).addClass("multi-hide");
$(".post-input-container").addClass("undis");
$(".post-reply-input").val("");
$("#post_input_1, #post_input_1 .post-input-container").show();
}
}); });
// $(".reply-icons").live("click",function(){
// if($(this).hasClass("multi-hide")){
// $(".multi-input-container").addClass("undis");
// $(".reply-icons").addClass("multi-hide");
// $(this).next().next().removeClass("undis");
// $(this).next().next().focus();
// $(this).removeClass("multi-hide");
// $(".post-reply-input").val("");
// }
// else{
// $(this).addClass("multi-hide");
// $(".post-input-container").addClass("undis");
// $(".post-reply-input").val("");
// $("#post_input_1, #post_input_1 .post-input-container").show();
// }
// });
// $(".post-reply-submit,#more_reply").click(function(){
// $(".reply-icons").addClass("multi-hide");
// $(".post-input-container").addClass("undis");
// $("#post_input_1, #post_input_1 .post-input-container").show();
// });
}) })
} }
} }

View File

@ -111,7 +111,6 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$loc
} }
var temp = data.comment.replace(/\n/g,'<br/>'); var temp = data.comment.replace(/\n/g,'<br/>');
temp = temp.replace(/^\:[a-z0-9_]+\:$/g, "[表情]");
var userInfo = { var userInfo = {
type: type, type: type,

View File

@ -266,4 +266,4 @@ a.underline {text-decoration:underline;}
/*.upload-input-container:after {content:" "; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); background-color:#ddd; background-image:url(../images/male.jpg); width:30px; height:30px; background-size:30px 30px; border-radius:50%;}*/ /*.upload-input-container:after {content:" "; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); background-color:#ddd; background-image:url(../images/male.jpg); width:30px; height:30px; background-size:30px 30px; border-radius:50%;}*/
.select-container {position:relative; padding-left:62px;} .select-container {position:relative; padding-left:62px;}
.select-text {position:absolute; left:15px;} .select-text {position:absolute; left:15px;}
.select-model {width:100%; border:none; color:#999; margin-top:8px;} .select-model {width:100%; border:none; color:#999; margin-top:8px; outline:none;}