Source: theme.js

/**
 * This file holds the event for changing the page theme.
 * 
 * @module scripts/events/main/theme
 */

import RequestHandler from "../../request_handler.js";
import PageHandler from "../../page_handler.js";
import EventHandler from "../../event_handler.js";

/**
 * Changes the theme of the page.
 * 
 * @function theme_event
 * 
 * @param {HTMLElement} target            - Is the targeted UI element that was clicked.
 * @param {object} args                   - The data attributes of the targeted element.
 * @param {RequestHandler} requestHandler - The handler for HTTP requests.
 * @param {PageHandler} pageHandler       - The handler for UI updates.
 * @param {EventHandler} eventHandler     - The handler for the events.
 */
function theme_event(target, args, requestHandler, pageHandler, eventHandler) {

    requestHandler.setTheme(pageHandler, true);
    eventHandler.isHandlingEvent = false;

}

export default theme_event;