From d61a86cad1daeb88ef493b2c7478b4328649b67e Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 26 Jul 2021 14:47:20 +0200 Subject: [PATCH] :bug: Frame moving with title with button different than left --- backend/src/app/http/middleware.clj | 2 +- frontend/src/app/main/ui/workspace.cljs | 2 +- .../src/app/main/ui/workspace/viewport/widgets.cljs | 10 ++++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/backend/src/app/http/middleware.clj b/backend/src/app/http/middleware.clj index cd3af606d..42babf3dc 100644 --- a/backend/src/app/http/middleware.clj +++ b/backend/src/app/http/middleware.clj @@ -85,7 +85,7 @@ (.close ^java.io.OutputStream output-stream)))))) (defn- impl-format-response-body - [response request] + [response _request] (let [body (:body response) opts {:type :json-verbose}] (cond diff --git a/frontend/src/app/main/ui/workspace.cljs b/frontend/src/app/main/ui/workspace.cljs index 533ce4524..a4e3f0355 100644 --- a/frontend/src/app/main/ui/workspace.cljs +++ b/frontend/src/app/main/ui/workspace.cljs @@ -6,7 +6,6 @@ (ns app.main.ui.workspace (:require - [app.util.timers :as ts] [app.main.data.messages :as dm] [app.main.data.workspace :as dw] [app.main.data.workspace.persistence :as dwp] @@ -27,6 +26,7 @@ [app.util.dom :as dom] [app.util.i18n :as i18n :refer [tr]] [app.util.object :as obj] + [app.util.timers :as ts] [okulary.core :as l] [rumext.alpha :as mf])) diff --git a/frontend/src/app/main/ui/workspace/viewport/widgets.cljs b/frontend/src/app/main/ui/workspace/viewport/widgets.cljs index 1fe2dce1d..9ca6c54a1 100644 --- a/frontend/src/app/main/ui/workspace/viewport/widgets.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/widgets.cljs @@ -95,10 +95,12 @@ on-mouse-down (mf/use-callback (mf/deps (:id frame) on-frame-select) - (fn [event] - (dom/prevent-default event) - (dom/stop-propagation event) - (on-frame-select event (:id frame)))) + (fn [bevent] + (let [event (.-nativeEvent bevent)] + (when (= 1 (.-which event)) + (dom/prevent-default event) + (dom/stop-propagation event) + (on-frame-select event (:id frame)))))) on-double-click (mf/use-callback