Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03092b3a authored by Akhil's avatar Akhil 🙂
Browse files

Async fixes

parent 907c56e0
Loading
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -4,8 +4,7 @@ if (OCA.Accessibility.highcontrast) {
}
const activeIconColorCode = "007fff";
const whiteColorCode = "ffffff";
const notifImgSelector = "#header .notifications .notifications-button img";

const notifButtonSelector = "#header .notifications .notifications-button";

function getSvgLinkCore(folder, svgName, color) {
  if (color.length) {
@@ -56,8 +55,9 @@ function replaceNavbarIcon(appId, currentLi, selector) {
}

function replaceNotificationIcon(imgSelector) {
  $(imgSelector).hide();
  const src = $(imgSelector).attr("src") || "";
  const notifButtonSelector = "#header .notifications .notifications-button";
  $(notifButtonSelector).css('visibility', 'visible');
  if (src.includes("notifications-new.svg")) {
    $(notifButtonSelector).removeClass("icon-notifications");
    $(notifButtonSelector).addClass("icon-notifications-new");
@@ -231,9 +231,18 @@ function replaceSettingsMenuIcons() {
  // TODO: fix the logout icon for highcontrast(it is not working well with SVG Controller)
}

function hideNotificationButton() {
  if (!($(notifButtonSelector).hasClass('icon-notifications') || $(notifButtonSelector).hasClass('icon-notifications-new'))) {
    $(notifButtonSelector).css('visibility', 'hidden');
  }
}

jQuery(window).load(function () {
  /* Notifications icon(Replace src on load) */
  replaceNotificationIcon(notifImgSelector);
  $(notifImgSelector).on("load", function () {
    replaceNotificationIcon(notifImgSelector);
  });
});

$(document).ready(function () {
@@ -241,7 +250,8 @@ $(document).ready(function () {

  if (bodyId === "body-user" || bodyId === "body-settings") {

    $(notifImgSelector).hide();
    hideNotificationButton();

    /* Navbar and navbar menus */
    replaceNavbarIcons();