Skip to content

Commit 8c9c5bd

Browse files
committed
option to close loading spinner
1 parent 3d08c56 commit 8c9c5bd

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

resources/public/index.html

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
<div id="clojure-spinner">
3737
<img src="/images/clojure-icon.gif" class="loader"/>
3838
<p>(loading)</p>
39+
<p id="loader-close">&times</p>
3940
</div>
4041

4142
<div id="about-container">

resources/public/main.css

+6
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,12 @@ er;
267267
color: rgba(0, 204, 255, 0.5);
268268
}
269269

270+
#clojure-spinner #loader-close {
271+
bottom: 0px;
272+
cursor: pointer;
273+
font-size: 20px;
274+
}
275+
270276
.loader {
271277
position: absolute;
272278
top: 50%;

src/replme/cljs/loading_mesage.cljs

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(ns replme.cljs.loading-message
22
(:require [cljs.core.async :refer [<! >! chan sub]]
33
[replme.cljs.websocket :as ws])
4-
(:use [jayq.core :only [$ fade-out append slide-down slide-up prop anim]])
4+
(:use [jayq.core :only [$ fade-out on append slide-down slide-up prop anim]])
55
(:require-macros [cljs.core.async.macros :refer [go-loop]]))
66

77
(enable-console-print!)
@@ -18,7 +18,10 @@
1818
(let [console-out-sub (sub socket-out-pub :console (chan))
1919
command-out-sub (sub socket-out-pub :command (chan))
2020
loading-spinner ($ :#clojure-spinner)
21-
loading-message ($ :#loading-message)]
21+
loading-message ($ :#loading-message)
22+
spinner-close ($ :#loader-close)]
23+
24+
(on spinner-close :click #(fade-out loading-spinner 500))
2225

2326
(go-loop [msg (<! command-out-sub)]
2427
(if (= (:message msg) "REPL OK")

0 commit comments

Comments
 (0)