Skip to content

Commit

Permalink
Tanoshi-web: Reader: Prevent popup to save images
Browse files Browse the repository at this point in the history
Signed-off-by: Luigi311 <[email protected]>
  • Loading branch information
luigi311 committed Aug 13, 2023
1 parent 991aa66 commit bdda045
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/tanoshi-web/src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,10 @@ impl Reader {
pub fn render(this: Rc<Self>) -> Dom {
html!("div", {
.attr("id", "this")
// Prevent context menu so mobile users dont get a popup asking to save the image
.event_with_options(&EventOptions::preventable(), clone!(this => move |e: events::ContextMenu| {
e.prevent_default();
}))
.future(this.current_page.signal().for_each(clone!(this => move |page| {
Self::update_page_read(this.clone(), page);

Expand Down

0 comments on commit bdda045

Please sign in to comment.