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

Commit 016c1bfb authored by Akhil's avatar Akhil 🙂
Browse files

Revert "Merge branch 'dev/notification-icon-fix' into 'main'"

parent 58b39ebd
Loading
Loading
Loading
Loading
+13 −24
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@ if (OCA.Accessibility.highcontrast) {
}
const activeIconColorCode = "007fff";
const whiteColorCode = "ffffff";
const notifButtonSelector = "#header .notifications .notifications-button";

function getSvgLinkCore(folder, svgName, color) {
  if (color.length) {
@@ -57,7 +56,7 @@ function replaceNavbarIcon(appId, currentLi, selector) {
function replaceNotificationIcon(imgSelector) {
  $(imgSelector).hide();
  const src = $(imgSelector).attr("src") || "";
  $(notifButtonSelector).css('visibility', 'visible');
  const notifButtonSelector = "#header .notifications .notifications-button";
  if (src.includes("notifications-new.svg")) {
    $(notifButtonSelector).removeClass("icon-notifications");
    $(notifButtonSelector).addClass("icon-notifications-new");
@@ -87,6 +86,13 @@ function replaceNavbarIcons() {
  /* Empty Search icon(Set through CSS) */
  $("#header .header-right .magnify-icon").empty();

  /* Notifications icon(Replace src on load) */

  const notifImgSelector = "#header .notifications .notifications-button img";
  replaceNotificationIcon(notifImgSelector);
  $(notifImgSelector).on("load", function () {
    replaceNotificationIcon(notifImgSelector);
  });
}

function replaceActivityIcons() {
@@ -103,7 +109,7 @@ function replaceActivityIcons() {
    comments: getSvgLinkCore("actions", "comment", ""),
    deck: getSvgLinkApp("deck", "deck-dark", ""),
    contacts: getSvgLinkCore("places", "contacts", ""),
    user_settings: getSvgLinkApp("e-user-support-center", "app", ""),
    user_settings: getSvgLinkApp("e-user-support-center", "app", "")
  };

  let currentActive = "";
@@ -231,27 +237,10 @@ 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 () {
  const bodyId = $("body").attr("id");

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

    hideNotificationButton();

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

@@ -276,6 +265,6 @@ $(document).ready(function () {
      replaceSettingsSectionIcons();
	}
  }
  $('#app-navigation [data-id="trashbin"]').removeClass("pinned first-pinned");
  $('#app-navigation [id="quota"]').addClass("pinned first-pinned");
  $('#app-navigation [data-id="trashbin"]').removeClass('pinned first-pinned');
  $('#app-navigation [id="quota"]').addClass('pinned first-pinned');
});