From 216c834a40fe159a0cc5cd9131dc5ec02dd6396d Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 8 Sep 2016 14:15:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E4=BF=AE=E6=94=B9=E8=B5=84?= =?UTF-8?q?=E6=96=99select=E6=A1=86=E5=8E=BB=E8=BE=B9=E6=A1=86=EF=BC=9B?= =?UTF-8?q?=E4=BA=8C=E7=BA=A7=E5=9B=9E=E5=A4=8D=E6=98=BE=E9=9A=90=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E6=95=88=E6=9E=9C=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wechat/directives/input_auto.js | 59 +++++++++++++------ .../wechat/directives/multi_reply.js | 40 ++++++++----- public/javascripts/wechat/others/factory.js | 1 - public/stylesheets/weui/weixin.css | 2 +- 4 files changed, 67 insertions(+), 35 deletions(-) diff --git a/public/javascripts/wechat/directives/input_auto.js b/public/javascripts/wechat/directives/input_auto.js index 9cd77188b..ea0a6bf1a 100644 --- a/public/javascripts/wechat/directives/input_auto.js +++ b/public/javascripts/wechat/directives/input_auto.js @@ -1,19 +1,40 @@ -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'); - }); - } - } -}); \ No newline at end of file +//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{ + restrict: 'A', + scope: {}, + link: function(scope, element){ + timer(function(){ + $(".post-reply-input").bind("input",function(){ + var copyInput = $(this).prev().children(); + var sendButton = $(this).next(); + copyInput.html($(this).val()); + var textHeight = copyInput[0].scrollHeight-10; + $(this).css("height",textHeight + "px"); + sendButton.click(function(){ + $(this).prev().css("height","18px"); + }) + }); + }); + } + } +}]); \ No newline at end of file diff --git a/public/javascripts/wechat/directives/multi_reply.js b/public/javascripts/wechat/directives/multi_reply.js index 6c4f1cccc..5b1e2b483 100644 --- a/public/javascripts/wechat/directives/multi_reply.js +++ b/public/javascripts/wechat/directives/multi_reply.js @@ -7,23 +7,35 @@ app.directive('multiReply',["$timeout",function(timer){ scope: {}, link: function(scope, element){ timer(function(){ - $(".reply-icons").live("click",function(){ - if($(this).hasClass("multi-hide")){ - $(".multi-input-container").addClass("undis"); - $(".reply-icons").addClass("multi-hide"); + $(".reply-icons").each(function(){ + $(this).toggle(function(){ $(this).next().next().removeClass("undis"); $(this).next().next().focus(); - $(this).removeClass("multi-hide"); - $(".post-reply-input").val(""); - $("#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(); - } + },function(){ + $(this).next().next().addClass("undis"); + }); }); +// $(".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(); +// }); }) } } diff --git a/public/javascripts/wechat/others/factory.js b/public/javascripts/wechat/others/factory.js index 37ca00114..01356003c 100644 --- a/public/javascripts/wechat/others/factory.js +++ b/public/javascripts/wechat/others/factory.js @@ -111,7 +111,6 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$loc } var temp = data.comment.replace(/\n/g,'
'); - temp = temp.replace(/^\:[a-z0-9_]+\:$/g, "[表情]"); var userInfo = { type: type, diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index 6a65b440a..ed8cf1bd6 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -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%;}*/ .select-container {position:relative; padding-left:62px;} .select-text {position:absolute; left:15px;} -.select-model {width:100%; border:none; color:#999; margin-top:8px;} \ No newline at end of file +.select-model {width:100%; border:none; color:#999; margin-top:8px; outline:none;} \ No newline at end of file