From ae2af3350684b87311f72561fc330a67de337019 Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Mon, 13 Apr 2015 01:20:41 +0500 Subject: [PATCH] fix of post splitting --- js/interface_common.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/js/interface_common.js b/js/interface_common.js index 69caff0..2170934 100644 --- a/js/interface_common.js +++ b/js/interface_common.js @@ -764,15 +764,15 @@ function replyTextInput(e) { var $tas = tweetForm.find("textarea"); splitedPostsCount = $tas.length; var icurrentta = $tas.index(this); // current textarea $tas index + if (splitedPostsCount > 1) + var pml = getPostSplitingPML(); + else + var pml = 140; var cci = getPostSpittingCI(icurrentta); var caretPos = $this.caret(); var reply_to = $this.attr('data-reply-to'); for (var i = 0; i < $tas.length; i++) { - if (splitedPostsCount > 1) - var pml = getPostSplitingPML(); - else - var pml = 140; if ($tas[i].value.length > pml) { if (pml === 140) pml = getPostSplitingPML(); @@ -802,6 +802,7 @@ function replyTextInput(e) { $tas = tweetForm.find("textarea"); splitedPostsCount = $tas.length; + pml = getPostSplitingPML(); $oldta.on('focus', function() { this.style.height = '80px'; @@ -832,6 +833,10 @@ function replyTextInput(e) { } $tas = tweetForm.find("textarea"); splitedPostsCount = $tas.length; + if (splitedPostsCount > 1) + pml = getPostSplitingPML(); + else + pml = 140; caretPos = -1; if (icurrentta >= i && icurrentta > 0) { icurrentta -= 1;