mirror of
https://github.com/we-promise/sure.git
synced 2026-04-07 22:34:47 +00:00
Implement transaction filtering UI (#578)
* Rough sketch of implementation * Consolidate auto submit controller * Store ransack params in session * Improve how summary is calculated for txns * Implement filters UI
This commit is contained in:
@@ -21,15 +21,17 @@ export default class extends Controller {
|
||||
|
||||
onTurboLoad = () => {
|
||||
this.updateClasses(this.defaultTabValue);
|
||||
}
|
||||
};
|
||||
|
||||
updateClasses = (selectedId) => {
|
||||
this.btnTargets.forEach((btn) => btn.classList.remove(this.activeClass));
|
||||
this.btnTargets.forEach((btn) =>
|
||||
btn.classList.remove(...this.activeClasses)
|
||||
);
|
||||
this.tabTargets.forEach((tab) => tab.classList.add("hidden"));
|
||||
|
||||
this.btnTargets.forEach((btn) => {
|
||||
if (btn.dataset.id === selectedId) {
|
||||
btn.classList.add(this.activeClass);
|
||||
btn.classList.add(...this.activeClasses);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -38,5 +40,5 @@ export default class extends Controller {
|
||||
tab.classList.remove("hidden");
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user