Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
left nav works with shift checkpoint
- Loading branch information
1 parent
b01f9d7
commit 8122f77
Showing
13 changed files
with
137 additions
and
71 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
17 changes: 10 additions & 7 deletions
17
pgml-dashboard/src/components/navigation/left_nav/web_app/template.html
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
22 changes: 20 additions & 2 deletions
22
pgml-dashboard/src/components/navigation/left_nav/web_app/web_app_controller.js
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 |
---|---|---|
@@ -1,8 +1,26 @@ | ||
import { Controller } from "@hotwired/stimulus"; | ||
|
||
export default class extends Controller { | ||
static targets = []; | ||
static targets = ['stateReference'] | ||
expand() { | ||
if( !this.stateReferenceTarget.classList.contains("show")) { | ||
const elements = this.element.getElementsByClassName('leftnav-collapse') | ||
for( const element of elements) { | ||
bootstrap.Collapse.getOrCreateInstance(element).show() | ||
} | ||
} | ||
} | ||
|
||
connect() {} | ||
collapse() { | ||
if( this.stateReferenceTarget.classList.contains("show")) { | ||
const elements = this.element.getElementsByClassName('leftnav-collapse') | ||
for( const element of elements) { | ||
bootstrap.Collapse.getOrCreateInstance(element, {toggle: false}).hide() | ||
} | ||
} | ||
} | ||
|
||
checkIfHover() { | ||
this.element.matches(':hover') ? this.expand() : this.collapse() | ||
} | ||
} |
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
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
Oops, something went wrong.