miniflux/ui/static/js/link_state_handler.js
2018-10-08 21:09:25 -07:00

10 lines
368 B
JavaScript

class LinkStateHandler {
static flip(element) {
let labelElement = document.createElement("span");
labelElement.className = "link-flipped-state";
labelElement.appendChild(document.createTextNode(element.dataset.labelNewState));
element.parentNode.appendChild(labelElement);
element.parentNode.removeChild(element);
}
}