-
-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: JS for dashboard wide filters (#2754)
* Add cards_controller.js * wip * Integrate updateCards to dashboard_card_controller * wip * Refactoring card_filters_controller * tweaks * comment * add card_classes method --------- Co-authored-by: Paul Bob <[email protected]> Co-authored-by: Paul Bob <[email protected]> Co-authored-by: Adrian Marin <[email protected]>
- Loading branch information
1 parent
9db6761
commit 75f76a0
Showing
5 changed files
with
37 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Controller } from '@hotwired/stimulus' | ||
import URI from 'urijs' | ||
|
||
export default class extends Controller { | ||
static targets = ['cards'] | ||
|
||
updateCards(event) { | ||
this.cardsTargets.forEach((frame) => { | ||
// Add date param to the existing frame.src | ||
frame.src = new URI(frame.src).setQuery('date', event.target.dataset.days).toString() | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters