This commit is contained in:
zapashcanon 2022-02-18 02:40:04 +01:00
parent abb70caabd
commit 47753368e3
No known key found for this signature in database
GPG key ID: 8981C3C62D1D28F1
7 changed files with 41 additions and 127 deletions

View file

@ -65,16 +65,12 @@ module Leaflet = struct
match
Brr_io.Storage.set_item storage (Jstr.of_string "lat") (Jv.to_jstr lat)
with
| (exception Jv.Error _)
| Error _ ->
failwith "can't set latlng storage"
| (exception Jv.Error _) | Error _ -> failwith "can't set latlng storage"
| Ok () -> (
match
Brr_io.Storage.set_item storage (Jstr.of_string "lng") (Jv.to_jstr lng)
with
| (exception Jv.Error _)
| Error _ ->
failwith "can't set latlng storage"
| (exception Jv.Error _) | Error _ -> failwith "can't set latlng storage"
| Ok () -> () )
let on_zoomend _event =
@ -83,9 +79,7 @@ module Leaflet = struct
match
Brr_io.Storage.set_item storage (Jstr.of_string "zoom") (Jv.to_jstr zoom)
with
| (exception Jv.Error _)
| Error _ ->
failwith "can't set latlng storage"
| (exception Jv.Error _) | Error _ -> failwith "can't set latlng storage"
| Ok () -> ()
let () =

View file

@ -9,9 +9,7 @@ let of_string = function
| "postImageBig" -> Some Big
| _ -> None
let to_string = function
| Small -> "postImage"
| Big -> "postImageBig"
let to_string = function Small -> "postImage" | Big -> "postImageBig"
(*change postImage class to make it bigger/smaller on click*)
let image_click post_image event =
@ -22,10 +20,7 @@ let image_click post_image event =
let new_class =
match of_string current_class with
| Some image_size ->
to_string
( match image_size with
| Big -> Small
| Small -> Big )
to_string (match image_size with Big -> Small | Small -> Big)
| None -> failwith "invalid image class name"
in
ignore