css refactor :]
This commit is contained in:
parent
81ab7856c6
commit
6e5aad77dd
5 changed files with 146 additions and 158 deletions
|
|
@ -1,13 +1,8 @@
|
|||
import { hijackClickEvent } from './main.js';
|
||||
import { hijackClickEvent } from "./main.js";
|
||||
|
||||
document.addEventListener('readystatechange', () => {
|
||||
document.querySelectorAll("#project-list .project-item").forEach(projectItem => {
|
||||
const link = projectItem.querySelector('a');
|
||||
hijackClickEvent(projectItem, link);
|
||||
});
|
||||
|
||||
document.querySelectorAll("#crew-list .crew-item .crew-info").forEach(crewItem => {
|
||||
const link = crewItem.querySelector('a.handle');
|
||||
hijackClickEvent(crewItem, link);
|
||||
document.addEventListener("readystatechange", () => {
|
||||
document.querySelectorAll(".project-item").forEach(container => {
|
||||
const link = container.querySelector("a");
|
||||
hijackClickEvent(container, link);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
export function hijackClickEvent(container, link) {
|
||||
export function hijackClickEvent(container, link) {
|
||||
container.addEventListener('click', event => {
|
||||
if (event.target.tagName.toLowerCase() === 'a') return;
|
||||
event.preventDefault();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue