diff --git a/src/main/frontend/components/content.cljs b/src/main/frontend/components/content.cljs index 8704758e6b..418c3661d3 100644 --- a/src/main/frontend/components/content.cljs +++ b/src/main/frontend/components/content.cljs @@ -181,11 +181,15 @@ (state/set-modal! #(export/export-blocks block-id)))} "Export") - ;; (if (srs/card-block? block) - ;; (ui/menu-link - ;; {:key "Preview Card" - ;; :on-click #(srs/preview [(db/pull [:block/uuid block-id])])} - ;; "Preview Card")) + (if (srs/card-block? block) + (ui/menu-link + {:key "Preview Card" + :on-click #(srs/preview [(db/pull [:block/uuid block-id])])} + "Preview Card") + (ui/menu-link + {:key "Make a Card" + :on-click #(srs/make-block-a-card! block-id)} + "Make a Card")) (ui/menu-link {:key "Copy as JSON" diff --git a/src/main/frontend/extensions/srs.cljs b/src/main/frontend/extensions/srs.cljs index 4463142a46..26add7ed04 100644 --- a/src/main/frontend/extensions/srs.cljs +++ b/src/main/frontend/extensions/srs.cljs @@ -611,3 +611,12 @@ (commands/register-slash-command ["Cloze" [[:editor/input "{{cloze }}" {:backward-pos 2}]] "Create a cloze"]) + +;; handlers +(defn make-block-a-card! + [block-id] + (when-let [content (:block/content (db/entity [:block/uuid block-id]))] + (editor-handler/save-block! + (state/get-current-repo) + block-id + (str (string/trim content) " #" card-hash-tag)))) diff --git a/src/main/frontend/ui.css b/src/main/frontend/ui.css index cdacb4bdc7..e2fbf2dd6f 100644 --- a/src/main/frontend/ui.css +++ b/src/main/frontend/ui.css @@ -112,8 +112,8 @@ } @media (min-width: 1024px) { - .panel-content { - min-width: 36rem; + .panel-content .ls-card { + min-width: 32rem; min-height: 24rem; } }