diff --git a/backend/src/app/srepl/cli.clj b/backend/src/app/srepl/cli.clj index e9c441d240..18c4d982f9 100644 --- a/backend/src/app/srepl/cli.clj +++ b/backend/src/app/srepl/cli.clj @@ -186,7 +186,7 @@ "canceled" "incomplete" "incomplete_expired" - "pass_due" + "past_due" "paused" "trialing" "unpaid"]] diff --git a/frontend/src/app/main/data/shortcuts.cljs b/frontend/src/app/main/data/shortcuts.cljs index febed4486e..0509da896a 100644 --- a/frontend/src/app/main/data/shortcuts.cljs +++ b/frontend/src/app/main/data/shortcuts.cljs @@ -148,17 +148,17 @@ (defn- bind! [shortcuts] - (let [msbind (fn [command callback type] + (->> shortcuts + (remove #(:disabled (second %))) + (run! (fn [[key {:keys [command fn type overwrite]}]] + (let [callback (wrap-cb key fn) + undefined (js* "(void 0)") + commands (if (vector? command) + (into-array command) + #js [command])] (if type - (mousetrap/bind command callback type) - (mousetrap/bind command callback)))] - (->> shortcuts - (remove #(:disabled (second %))) - (run! (fn [[key {:keys [command fn type]}]] - (let [callback (wrap-cb key fn)] - (if (vector? command) - (run! #(msbind % callback type) command) - (msbind command callback type)))))))) + (mousetrap/bind commands callback type overwrite) + (mousetrap/bind commands callback undefined overwrite))))))) (defn- reset! ([] diff --git a/frontend/src/app/main/ui/workspace/colorpicker/shortcuts.cljs b/frontend/src/app/main/ui/workspace/colorpicker/shortcuts.cljs index 8a25ee1d50..edea0f64d8 100644 --- a/frontend/src/app/main/ui/workspace/colorpicker/shortcuts.cljs +++ b/frontend/src/app/main/ui/workspace/colorpicker/shortcuts.cljs @@ -24,5 +24,6 @@ {:delete-stop {:tooltip (ds/supr) :command ["del" "backspace"] :subsections [:edit] + :overwrite true :fn #(st/emit! (dwc/remove-gradient-stop))}})) diff --git a/frontend/vendor/mousetrap/index.js b/frontend/vendor/mousetrap/index.js index 06866e6a5b..5a0bc3e0bc 100644 --- a/frontend/vendor/mousetrap/index.js +++ b/frontend/vendor/mousetrap/index.js @@ -821,7 +821,7 @@ function Mousetrap(targetElement) { * @param {number=} level - what part of the sequence the command is * @returns void */ - function _bindSingle(combination, callback, action, sequenceName, level) { + function _bindSingle(combination, callback, action, sequenceName, level, overwrite) { // store a direct mapped reference for use with Mousetrap.trigger self._directMap[combination + ':' + action] = callback; @@ -845,8 +845,10 @@ function Mousetrap(targetElement) { // a callback is added for this key self._callbacks[info.key] = self._callbacks[info.key] || []; - // // remove an existing match if there is one - // _getMatches(info.key, info.modifiers, {type: info.action}, sequenceName, combination, level); + // remove an existing match if there is one + if (overwrite) { + _getMatches(info.key, info.modifiers, {type: info.action}, sequenceName, combination, level); + } // add this call back to the array // if it is a sequence put it at the beginning @@ -872,9 +874,9 @@ function Mousetrap(targetElement) { * @param {string|undefined} action * @returns void */ - self._bindMultiple = function(combinations, callback, action) { + self._bindMultiple = function(combinations, callback, action, overwrite) { for (var i = 0; i < combinations.length; ++i) { - _bindSingle(combinations[i], callback, action); + _bindSingle(combinations[i], callback, action, undefined, undefined, overwrite); } }; @@ -899,10 +901,10 @@ function Mousetrap(targetElement) { * @param {string=} action - 'keypress', 'keydown', or 'keyup' * @returns void */ -Mousetrap.prototype.bind = function(keys, callback, action) { +Mousetrap.prototype.bind = function(keys, callback, action, overwrite) { var self = this; keys = keys instanceof Array ? keys : [keys]; - self._bindMultiple.call(self, keys, callback, action); + self._bindMultiple.call(self, keys, callback, action, overwrite); return self; };