From 879140b8cec122c598715b49c1d8c3bef1e7342f Mon Sep 17 00:00:00 2001 From: Keegan George Date: Wed, 12 Oct 2022 09:49:54 -0700 Subject: [PATCH] FIX: Make edit table button text not selectable (#29) Making the text of the edit table button not selectable so that when post's contents are copied, the edit table label does not copy over as well. --- javascripts/discourse/api-initializers/table-editor.js | 3 ++- scss/post/table-edit-decorator.scss | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/javascripts/discourse/api-initializers/table-editor.js b/javascripts/discourse/api-initializers/table-editor.js index 76c1ea7..9846584 100644 --- a/javascripts/discourse/api-initializers/table-editor.js +++ b/javascripts/discourse/api-initializers/table-editor.js @@ -18,7 +18,8 @@ export default apiInitializer("0.11.1", (api) => { "open-popup-link", "btn-default", "btn", - "btn-icon-text" + "btn-icon-text", + "btn-edit-table" ); const editIcon = create( iconNode("pencil-alt", { class: "edit-table-icon" }) diff --git a/scss/post/table-edit-decorator.scss b/scss/post/table-edit-decorator.scss index 52ecb9d..4099586 100644 --- a/scss/post/table-edit-decorator.scss +++ b/scss/post/table-edit-decorator.scss @@ -2,3 +2,11 @@ display: inline; margin-inline: 0.25em; } + +.btn-edit-table { + -webkit-user-select: none; + -webkit-touch-callout: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +}