<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mike Nomad</title>
    <description>The latest articles on DEV Community by Mike Nomad (@nomadtechiemike).</description>
    <link>https://dev.to/nomadtechiemike</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F776942%2Fd99f349c-92ec-4221-ad28-a202a4f42cf2.jpeg</url>
      <title>DEV Community: Mike Nomad</title>
      <link>https://dev.to/nomadtechiemike</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nomadtechiemike"/>
    <language>en</language>
    <item>
      <title>How can I trigger two functions</title>
      <dc:creator>Mike Nomad</dc:creator>
      <pubDate>Mon, 17 Jul 2023 10:15:30 +0000</pubDate>
      <link>https://dev.to/nomadtechiemike/how-can-i-trigger-two-functions-he9</link>
      <guid>https://dev.to/nomadtechiemike/how-can-i-trigger-two-functions-he9</guid>
      <description>&lt;p&gt;Hi I am a bit new to Laravel, I bought a template and I am trying to add Chatify to it, Chatify has its own Light/Dark mode and my template also has a light/dark mode, what I would like to do it have the template switch both.&lt;/p&gt;

&lt;p&gt;These are the two functions, they are in different files.&lt;/p&gt;

&lt;p&gt;`   // Theme Change by Header Button - main App switch&lt;br&gt;
$("#themeMood").on("click", function () {&lt;br&gt;
    if (currentTheme === "light") {&lt;br&gt;
        currentTheme = "dark";&lt;br&gt;
    } else {&lt;br&gt;
        currentTheme = "light";&lt;br&gt;
    }&lt;br&gt;
    localStorage.theme = currentTheme;&lt;br&gt;
    location.reload();&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;$("#grayScale").on("click", function () {&lt;br&gt;
    if ($("html").hasClass("grayScale")) {&lt;br&gt;
        $("html").removeClass("grayScale");&lt;br&gt;
        localStorage.effect = "";&lt;br&gt;
    } else {&lt;br&gt;
        $("html").addClass("grayScale");&lt;br&gt;
        localStorage.effect = "grayScale";&lt;br&gt;
    }&lt;br&gt;
});&lt;br&gt;
// Switch to Dark/Light mode  - Chatify switch&lt;br&gt;
$("body").on("click", ".dark-mode-switch", function () {&lt;br&gt;
    if ($(this).attr("data-mode") == "0") {&lt;br&gt;
        $(this).attr("data-mode", "1");&lt;br&gt;
        $(this).removeClass("far");&lt;br&gt;
        $(this).addClass("fas");&lt;br&gt;
        dark_mode = "dark";&lt;br&gt;
    } else {&lt;br&gt;
        $(this).attr("data-mode", "0");&lt;br&gt;
        $(this).removeClass("fas");&lt;br&gt;
        $(this).addClass("far");&lt;br&gt;
        dark_mode = "light";&lt;br&gt;
    }&lt;br&gt;
});&lt;br&gt;
`&lt;/p&gt;

&lt;p&gt;The button in Chatify uses the dark-mode-switch class and the template uses the themeMood id I have tried adding the class to the template button but its not triggering the function, I tried moving the function to the same file, but still didn't work.&lt;/p&gt;

&lt;p&gt;Any idea how I can get this to work? &lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
