Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 6154a43b authored by Pierre Jarriges's avatar Pierre Jarriges
Browse files

Merge branch 'master' of lab.frogg.it:kuadrado-software/kuadrado-website

parents c0c3b40a d5ecf5c9
No related branches found
No related tags found
1 merge request!13Dev
......@@ -44,7 +44,10 @@ pub fn create_static_view(app_state: &AppState, article: &Article) -> Result<(),
.to_owned();
if !art_image_uri.is_empty() {
art_image_uri = format!("/assets/images/{}", art_image_uri);
art_image_uri = format!(
"{}://{}/assets/images/{}",
app_state.env.server_protocol, app_state.env.server_host, art_image_uri,
);
}
let default_url = String::new();
......
{
"name": "kuadrado-website",
"version": "1.0.4",
"version": "1.1.0",
"description": "Presentation website of Kuadrado Software",
"main": "src/main.js",
"scripts": {
......
......@@ -10,6 +10,7 @@ class ImageCarousel {
};
this.RUN_INTERVAL = 5000;
this.props.images.length > 1 && this.run();
this.toggle_fullscreen = this.toggle_fullscreen.bind(this);
}
run() {
......@@ -33,6 +34,19 @@ class ImageCarousel {
this.refresh();
}
toggle_fullscreen() {
this.state.fullscreen = !this.state.fullscreen;
document.getElementById(this.id).classList.toggle("fullscreen");
document.body.style.overflow = this.state.fullscreen ? "hidden" : "initial";
if (this.state.fullscreen) {
window.addEventListener("keydown", this.toggle_fullscreen);
} else {
window.removeEventListener("keydown", this.toggle_fullscreen);
}
}
refresh() {
obj2htm.subRender(this.render_image(), document.getElementById(this.id + "-img-element"), {
mode: "replace",
......@@ -79,9 +93,7 @@ class ImageCarousel {
contents: this.state.fullscreen ? "" : "",
onclick: e => {
e.stopImmediatePropagation();
this.state.fullscreen = !this.state.fullscreen;
document.getElementById(this.id).classList.toggle("fullscreen");
document.body.style.overflow = this.state.fullscreen ? "hidden" : "initial";
this.toggle_fullscreen();
this.refresh();
},
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment