From a8a6b38c2838e63f33a76043268dceab46945efd Mon Sep 17 00:00:00 2001 From: Ilya Daynatovich Date: Fri, 4 Nov 2016 12:40:21 +0200 Subject: [PATCH] Updated method for showing/hiding elements --- modules/UI/UI.js | 4 ++-- modules/UI/util/UIUtil.js | 26 ++++++++++++++++++++------ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/modules/UI/UI.js b/modules/UI/UI.js index 383b537ba..7111ed0c6 100644 --- a/modules/UI/UI.js +++ b/modules/UI/UI.js @@ -443,10 +443,10 @@ UI.start = function () { // Display notice message at the top of the toolbar if (config.noticeMessage) { $('#noticeText').text(config.noticeMessage); - $('#notice').css({display: 'block'}); + UIUtil.showElement('notice'); } } else { - document.querySelector('#mainToolbarContainer').classList.add('hide'); + UIUtil.hideElement('mainToolbarContainer'); FilmStrip.setupFilmStripOnly(); messageHandler.enableNotifications(false); JitsiPopover.enabled = false; diff --git a/modules/UI/util/UIUtil.js b/modules/UI/util/UIUtil.js index 8e7d74fc5..708e3fb65 100644 --- a/modules/UI/util/UIUtil.js +++ b/modules/UI/util/UIUtil.js @@ -219,10 +219,17 @@ const TOOLTIP_POSITIONS = { * @param {String} the identifier of the element to show */ showElement(id) { - if ($("#"+id).hasClass("hide")) - $("#"+id).removeClass("hide"); + let element = document.getElementById(id); - $("#"+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 */ hideElement(id) { - if ($("#"+id).hasClass("show")) - $("#"+id).removeClass("show"); + let element = document.getElementById(id); - $("#"+id).addClass("hide"); + if (!element) { + return; + } + + if(element.classList.contains('show')) { + element.classList.remove('show'); + } + + element.classList.add('hide'); }, /**