From 976711ef1cd60c337899d89dfc8be41c4cd71282 Mon Sep 17 00:00:00 2001 From: Rick Butterfield Date: Fri, 22 Oct 2021 09:52:22 +0100 Subject: [PATCH] Publish hotkey doesn't work in RTE --- .../common/directives/components/content/edit.controller.js | 4 ++++ .../src/common/services/tinymce.service.js | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js index 4a1988cc275c..2d78b4b2bd97 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js @@ -200,6 +200,10 @@ } })); + evts.push(eventsService.on("rte.shortcut.publish", function () { + $scope.saveAndPublish(); + })); + evts.push(eventsService.on("content.saved", function () { // Clear out localstorage keys that start with tinymce__ // When we save/perist a content node diff --git a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js index 46c047448f88..d8e50e9860a0 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js @@ -1221,6 +1221,12 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s }); }); + editor.addShortcut('Ctrl+P', '', function () { + angularHelper.safeApply($rootScope, function () { + eventsService.emit("rte.shortcut.publish"); + }); + }); + }, insertLinkInEditor: function (editor, target, anchorElm) {