Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitba0ecab

Browse files
committed
save
1 parentc81672a commitba0ecab

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

‎pgml-dashboard/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
import{Controller}from'@hotwired/stimulus'
1+
import{Controller}from"@hotwired/stimulus";
22

33
exportdefaultclassextendsController{
4-
staticinitialized=false
4+
staticinitialized=false;
55

66
initialize(){
7-
if(this.constructor.initialized)return
7+
if(this.constructor.initialized)return;
88

9-
window.addEventListener("turbo:before-visit",function(event){
10-
localStorage.setItem('scrollpos',window.scrollY);
9+
window.addEventListener("turbo:before-visit",function(event){
10+
localStorage.setItem("scrollpos",window.scrollY);
1111
});
1212

13-
window.addEventListener("turbo:load",function(event){
14-
constscrollpos=localStorage.getItem('scrollpos');
13+
window.addEventListener("turbo:load",function(event){
14+
constscrollpos=localStorage.getItem("scrollpos");
1515
if(scrollpos){
1616
window.scrollTo(0,scrollpos);
1717
}
18-
})
18+
});
1919

20-
this.constructor.initialized=true
20+
this.constructor.initialized=true;
2121
}
2222
}
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import{Controller}from"@hotwired/stimulus";
22

33
exportdefaultclassextendsController{
4-
statictargets=["button","link"];
4+
statictargets=["button"];
55

66
selectSwitchOption(e){
77
this.buttonTargets.forEach((target)=>{
@@ -12,8 +12,10 @@ export default class extends Controller {
1212
e.currentTarget.classList.add("active");
1313
e.currentTarget.ariaPressed=true;
1414

15-
if(this.hasLinkTarget){
16-
this.linkTarget.click()
15+
constlink=e.currentTarget.querySelector("a");
16+
17+
if(link){
18+
link.click();
1719
}
1820
}
1921
}

‎pgml-dashboard/src/components/inputs/switch_v_2/template.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
data-action="<%= option.actions %>"
1717
>
1818
<% if let Some(ref link) = option.link { %>
19-
<ahref="<%= link %>"class="d-none"data-inputs-switch-v-2-target="link"></a>
19+
<ahref="<%= link %>"class="d-none"></a>
2020
<% } %>
21-
21+
2222
<% if let Some(icon) = option.icon { %>
2323
<spanclass="material-symbols-outlined">
2424
<%= icon %>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp