mirror of
https://github.com/nerzhul/ocsms.git
synced 2025-06-07 16:06:15 +00:00
Hide the header bar when no conversation was selected
This commit is contained in:
parent
6404bf3de7
commit
d3a55e5b15
18
js/script.js
18
js/script.js
@ -27,6 +27,9 @@ $.urlParam = function(name){
|
||||
var refreshConversation = function() {
|
||||
// if no conversation selected, then don't fetch page
|
||||
if (curPhoneNumber == null) {
|
||||
if ($('#app-content-header').is(':visible')) {
|
||||
$('#app-content-header').hide();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@ -41,6 +44,10 @@ var refreshConversation = function() {
|
||||
$('.msg-endtag').before(conversationBuf);
|
||||
$('#app-content-wrapper').scrollTop(1E10);
|
||||
}
|
||||
|
||||
if ($('#app-content-header').is(':hidden')) {
|
||||
$('#app-content-header').show();
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
@ -62,6 +69,10 @@ function fetchConversation(phoneNumber) {
|
||||
$('#ocsms-phone-opt-number').html(phoneNumber);
|
||||
}
|
||||
|
||||
if ($('#app-content-header').is(':hidden')) {
|
||||
$('#app-content-header').show();
|
||||
}
|
||||
|
||||
$('#app-content-wrapper').html(conversationBuf);
|
||||
$('#app-content-wrapper').scrollTop(1E10);
|
||||
|
||||
@ -178,6 +189,13 @@ function changeSelectedConversation(item) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Don't show message headers if no conversation selected
|
||||
else {
|
||||
if ($('#app-content-header').is(':visible')) {
|
||||
$('#app-content-header').hide();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
setInterval(refreshConversation, 10000);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user