aboutsummaryrefslogtreecommitdiff
path: root/src/hl
diff options
context:
space:
mode:
authorDavid Barksdale <amatus@amat.us>2018-10-08 10:31:12 -0500
committerDavid Barksdale <amatus@amat.us>2018-10-08 10:31:12 -0500
commit4c01661d1d23f0eb097c2287b34be21bc0e5af5d (patch)
treeae05e9c41d6d2d0affd6a8c0aeba6e1462d2727c /src/hl
parent19e0c9a5c811ade500666acd74fc5132b5e2e480 (diff)
Add stop search button
Diffstat (limited to 'src/hl')
-rw-r--r--src/hl/index.cljs.hl14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/hl/index.cljs.hl b/src/hl/index.cljs.hl
index 3c51e48..be1d082 100644
--- a/src/hl/index.cljs.hl
+++ b/src/hl/index.cljs.hl
@@ -90,6 +90,14 @@
(swap! search-results conj info))
(recur)))))
+(defn stop-search
+ []
+ (swap! active-search
+ (fn [old-search]
+ (when old-search
+ (filesharing/stop-search old-search))
+ nil)))
+
(defn start-download
[uri anonymity state-cell progress-cell object-cell]
(let [download (filesharing/start-download uri anonymity)
@@ -175,7 +183,11 @@
:error (zero? connection-count)
:loading active-search})
:submit #(start-search (.-value input) @anonymity)
- (i :class (cell= {:icon true :search true}))
+ (i :class "search icon")
+ (div :class "ui negative icon button"
+ :toggle active-search
+ :click stop-search
+ (i :class "cancel icon"))
input)))
(defelem ui-publish