mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-03-13 05:51:03 +00:00
dynamic width and margin for post preview, some other fixes
This commit is contained in:
parent
c93d410c00
commit
4e7e09456f
@ -581,9 +581,15 @@ function composeNewPost(e, postAreaNew) {
|
||||
function posPostPreview(event) {
|
||||
var textArea = $(event.target);
|
||||
var postPreview = textArea.siblings('#post-preview');
|
||||
if (!postPreview.length)
|
||||
postPreview = $('#post-preview-template').children().clone();
|
||||
postPreview.html(htmlFormatMsg(textArea[0].value, []))
|
||||
if (!postPreview.length) {
|
||||
postPreview = $('#post-preview-template').children().clone()
|
||||
.css('margin-left', textArea.css('margin-left'))
|
||||
.css('margin-right', textArea.css('margin-right'))
|
||||
;
|
||||
postPreview.css('width', textArea.css('width')
|
||||
- postPreview.css('padding-left') - postPreview.css('padding-right'));
|
||||
}
|
||||
postPreview.html(htmlFormatMsg(textArea[0].value, [])).show();
|
||||
textArea.before(postPreview);
|
||||
}
|
||||
|
||||
@ -1207,6 +1213,8 @@ function postSubmit(e, oldLastPostId) {
|
||||
|
||||
var $replyText = $this.closest('.post-area-new').find('textarea');
|
||||
|
||||
$replyText.siblings('#post-preview').hide();
|
||||
|
||||
var $postOrig = $this.closest('.post-data');
|
||||
if (!$postOrig.length) {
|
||||
$postOrig = $this.closest('.modal-content').find('.post-data');
|
||||
|
Loading…
x
Reference in New Issue
Block a user