Skip to content

Commit

Permalink
Fix: readOnly - active buttons JiHong88#1418
Browse files Browse the repository at this point in the history
  • Loading branch information
JiHong88 authored and onedark23 committed Aug 12, 2024
1 parent b24bc57 commit a30ee29
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
9 changes: 9 additions & 0 deletions src/lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -6431,6 +6431,10 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
},

_applyTagEffects: function () {
if (util.hasClass(context.element.wysiwyg, 'se-read-only')) {
return false;
}

let selectionNode = core.getSelectionNode();
if (selectionNode === core.effectNode) return;
core.effectNode = selectionNode;
Expand Down Expand Up @@ -6612,6 +6616,11 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
},

onClick_wysiwyg: function (e) {
// if (util.hasClass(context.element.wysiwyg, 'se-read-only')) {
// e.preventDefault();
// return false;
// }

const targetElement = e.target;

if (core.isReadOnly) {
Expand Down
10 changes: 3 additions & 7 deletions test/dev/suneditor_build_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1038,13 +1038,9 @@ let s2 = window.s2 = suneditor.create(document.getElementById('editor2'), {
// addTagsWhitelist: "fld|sort|sortType|lst|lstfld|header|section",
lineAttrReset: 'class',
imageAccept: '*/*',
value: `<div class="se-component se-video-container __se__float-none" style="width: 100%;">
<figure style="width: 100%; height: 56.25%; padding-bottom: 56.25%;">
<video controls="true" autoplay="true" muted="true" src="http://localhost:3000/public/files/d55bddf8d62910879ed9f605522149a8.mp4" data-proportion="true" style="width: 100%; height: 100%;" data-percentage="100%,56.25%" width="100%" height="56.25%" data-size="100%,56.25%" data-align="none" data-index="0" data-file-name="SampleVideo_1280x720_1mb.mp4" data-file-size="1055736" data-origin="100%,56.25%"></video>
</figure>
</div>
<p>aaa</p>`,
value: `<p>Ôtez la <span style="color: rgb(235, 141, 117)">complexité</span>,<br>
M.Biz vous apporte des solutions utiles<br>
</p>`,
// attributesWhitelist: {
// all: 'style|class',
// },
Expand Down

0 comments on commit a30ee29

Please sign in to comment.