aboutsummaryrefslogtreecommitdiff
path: root/webAO/dom/toggleEffect.js
blob: 699937babc3650b9205d623f92d4cf314e025276 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* eslint no-param-reassign: ["error",
{ "props": true, "ignorePropertyModificationsFor": ["button"] }] */
/**
 * Highlights and selects an effect for in-character chat.
 * If the same effect button is selected, then the effect is canceled.
 * @param {string} effect the new effect to be selected
 */
export function toggleEffect(button) {
  if (button.classList.contains('dark')) {
    button.className = 'client_button';
  } else {
    button.className = 'client_button dark';
  }
}
window.toggleEffect = toggleEffect;
export default toggleEffect;