Skip to content

Commit

Permalink
editable items in info full-width
Browse files Browse the repository at this point in the history
  • Loading branch information
littlebenlittle committed Jun 8, 2024
1 parent 599420d commit 919e626
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
19 changes: 15 additions & 4 deletions ui/src/pages/player/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,18 @@ pub fn Info() -> impl IntoView {
});
view! {
<div id="video-info">
<ClickToEdit sig=title/>

{
#[cfg(feature = "demo")]
view! {
<p>
"You can edit some metadata items (title, shortname, format) \
by clicking on them."
</p>
}
}
<h3>
<ClickToEdit sig=title/>
</h3>
<table>
<tr class="editable">
<td>"Shortname"</td>
Expand Down Expand Up @@ -79,7 +89,7 @@ fn ClickToEdit(sig: RwSignal<String>) -> impl IntoView {
});
view! {
<input
hidden=move || !edit()
class:hidden=move || !edit()
node_ref=node
type="text"
value=val.get_untracked()
Expand All @@ -102,12 +112,13 @@ fn ClickToEdit(sig: RwSignal<String>) -> impl IntoView {
/>

<span
hidden=move || edit()
class:hidden=move || edit()
on:click=move |_| {
set_edit(true);
node.get().unwrap().select();
}
>

{move || sig.get()}
</span>
}
Expand Down
5 changes: 5 additions & 0 deletions ui/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ nav ul {

span {
width: 100%;
display: block;
}
}

Expand Down Expand Up @@ -445,4 +446,8 @@ nav ul {
height: 256px;
overflow-y: auto;
}
}

.hidden {
display: none !important;
}

0 comments on commit 919e626

Please sign in to comment.