mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-09 15:35:47 +01:00
closes #749
This commit is contained in:
@@ -996,13 +996,13 @@ define(['composer'], function(composer) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var container = $(document.body),
|
var container = $(window),
|
||||||
scrollTo = $('#post_anchor_' + pid),
|
scrollTo = $('#post_anchor_' + pid),
|
||||||
tid = $('#post-container').attr('data-tid');
|
tid = $('#post-container').attr('data-tid');
|
||||||
|
|
||||||
function animateScroll() {
|
function animateScroll() {
|
||||||
$('body,html').animate({
|
$('window,html').animate({
|
||||||
scrollTop: scrollTo.offset().top - container.offset().top + container.scrollTop() - $('#header-menu').height()
|
scrollTop: scrollTo.offset().top + container.scrollTop() - $('#header-menu').height()
|
||||||
}, 400);
|
}, 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ define(['taskbar', 'string'], function(taskbar, S) {
|
|||||||
|
|
||||||
chatModal.attr('id', 'chat-modal-' + touid);
|
chatModal.attr('id', 'chat-modal-' + touid);
|
||||||
chatModal.attr('UUID', uuid);
|
chatModal.attr('UUID', uuid);
|
||||||
|
chatModal.css("position", "fixed");
|
||||||
chatModal.appendTo($('body'));
|
chatModal.appendTo($('body'));
|
||||||
chatModal.draggable({
|
chatModal.draggable({
|
||||||
start:function() {
|
start:function() {
|
||||||
@@ -96,9 +97,10 @@ define(['taskbar', 'string'], function(taskbar, S) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
module.center = function(chatModal) {
|
module.center = function(chatModal) {
|
||||||
chatModal.css("position", "fixed");
|
|
||||||
chatModal.css("left", Math.max(0, (($(window).width() - $(chatModal).outerWidth()) / 2) + $(window).scrollLeft()) + "px");
|
chatModal.css("left", Math.max(0, (($(window).width() - $(chatModal).outerWidth()) / 2) + $(window).scrollLeft()) + "px");
|
||||||
chatModal.css("top", "0px");
|
chatModal.css("top", "0px");
|
||||||
|
chatModal.css("zIndex", 2000);
|
||||||
|
chatModal.find('#chat-message-input').focus();
|
||||||
return chatModal;
|
return chatModal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,7 +111,6 @@ define(['taskbar', 'string'], function(taskbar, S) {
|
|||||||
checkOnlineStatus(chatModal);
|
checkOnlineStatus(chatModal);
|
||||||
taskbar.updateActive(uuid);
|
taskbar.updateActive(uuid);
|
||||||
scrollToBottom(chatModal.find('#chat-content'));
|
scrollToBottom(chatModal.find('#chat-content'));
|
||||||
chatModal.find('#chat-message-input').focus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.minimize = function(uuid) {
|
module.minimize = function(uuid) {
|
||||||
@@ -163,10 +164,12 @@ define(['taskbar', 'string'], function(taskbar, S) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function scrollToBottom(chatContent) {
|
function scrollToBottom(chatContent) {
|
||||||
|
if(chatContent[0]) {
|
||||||
chatContent.scrollTop(
|
chatContent.scrollTop(
|
||||||
chatContent[0].scrollHeight - chatContent.height()
|
chatContent[0].scrollHeight - chatContent.height()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
module.toggleNew = function(uuid, state) {
|
module.toggleNew = function(uuid, state) {
|
||||||
taskbar.toggleNew(uuid, state);
|
taskbar.toggleNew(uuid, state);
|
||||||
|
|||||||
Reference in New Issue
Block a user