Updated method for showing/hiding elements

This commit is contained in:
Ilya Daynatovich 2016-11-04 12:40:21 +02:00
parent 68ab87cc0d
commit a8a6b38c28
2 changed files with 22 additions and 8 deletions

View File

@ -443,10 +443,10 @@ UI.start = function () {
// Display notice message at the top of the toolbar // Display notice message at the top of the toolbar
if (config.noticeMessage) { if (config.noticeMessage) {
$('#noticeText').text(config.noticeMessage); $('#noticeText').text(config.noticeMessage);
$('#notice').css({display: 'block'}); UIUtil.showElement('notice');
} }
} else { } else {
document.querySelector('#mainToolbarContainer').classList.add('hide'); UIUtil.hideElement('mainToolbarContainer');
FilmStrip.setupFilmStripOnly(); FilmStrip.setupFilmStripOnly();
messageHandler.enableNotifications(false); messageHandler.enableNotifications(false);
JitsiPopover.enabled = false; JitsiPopover.enabled = false;

View File

@ -219,10 +219,17 @@ const TOOLTIP_POSITIONS = {
* @param {String} the identifier of the element to show * @param {String} the identifier of the element to show
*/ */
showElement(id) { showElement(id) {
if ($("#"+id).hasClass("hide")) let element = document.getElementById(id);
$("#"+id).removeClass("hide");
$("#"+id).addClass("show"); if (!element) {
return;
}
if(element.classList.contains('hide')) {
element.classList.remove('hide');
}
element.classList.add('show');
}, },
/** /**
@ -231,10 +238,17 @@ const TOOLTIP_POSITIONS = {
* @param {String} the identifier of the element to hide * @param {String} the identifier of the element to hide
*/ */
hideElement(id) { hideElement(id) {
if ($("#"+id).hasClass("show")) let element = document.getElementById(id);
$("#"+id).removeClass("show");
$("#"+id).addClass("hide"); if (!element) {
return;
}
if(element.classList.contains('show')) {
element.classList.remove('show');
}
element.classList.add('hide');
}, },
/** /**