leksy-editor 2.1.1 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/constant.js +1 -0
- package/index.js +1 -0
- package/package.json +1 -1
- package/tab.js +4 -2
- package/utilities.js +1 -1
package/constant.js
CHANGED
package/index.js
CHANGED
|
@@ -307,6 +307,7 @@ class LeksyEditor {
|
|
|
307
307
|
core.elements.editor.contentEditable = !disabled;
|
|
308
308
|
if (disabled) changeAllToolbarState(core, 'disabled')
|
|
309
309
|
else changeAllToolbarState(core, 'enabled')
|
|
310
|
+
renderTabs(core, options)
|
|
310
311
|
},
|
|
311
312
|
updateCssVariables: (newVariables) => {
|
|
312
313
|
const variableMap = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "leksy-editor",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"description": "Leksy Editor is an alternative to traditional WYSIWYG editors, designed primarily for creating mail templates, blogs, and documents without any content manipulation.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"directories": {
|
package/tab.js
CHANGED
|
@@ -137,6 +137,7 @@ const renderTabs = (core, options) => {
|
|
|
137
137
|
};
|
|
138
138
|
|
|
139
139
|
tabItem.ondblclick = () => {
|
|
140
|
+
if (options.disabled) return
|
|
140
141
|
clearTimeout(clickTimer);
|
|
141
142
|
renameTab(core, tab.tabId, titleInput, options);
|
|
142
143
|
};
|
|
@@ -186,7 +187,7 @@ const renderTabs = (core, options) => {
|
|
|
186
187
|
leftSection.appendChild(span);
|
|
187
188
|
leftSection.appendChild(titleInput);
|
|
188
189
|
tabItem.appendChild(leftSection);
|
|
189
|
-
tabItem.appendChild(menuBtn);
|
|
190
|
+
if (!options.disabled) tabItem.appendChild(menuBtn);
|
|
190
191
|
|
|
191
192
|
const tabItemContainer = document.createElement('div');
|
|
192
193
|
tabItemContainer.id = tab.tabId;
|
|
@@ -247,7 +248,7 @@ const renderTabs = (core, options) => {
|
|
|
247
248
|
tabListContainer.classList.add('show')
|
|
248
249
|
}
|
|
249
250
|
|
|
250
|
-
rightDiv.appendChild(addBtn);
|
|
251
|
+
if (!options.disabled) rightDiv.appendChild(addBtn);
|
|
251
252
|
rightDiv.appendChild(expandBtn);
|
|
252
253
|
|
|
253
254
|
tabHeader.appendChild(headerTitle);
|
|
@@ -432,6 +433,7 @@ const showContextMenu = (core, tab, event, level, options) => {
|
|
|
432
433
|
};
|
|
433
434
|
|
|
434
435
|
const createTab = (core, options) => {
|
|
436
|
+
if (options.disabled) return
|
|
435
437
|
const newTab = {
|
|
436
438
|
tabTitle: `Tab ${core.state.tabs.length + 1}`,
|
|
437
439
|
tabId: uuidv4(),
|
package/utilities.js
CHANGED
|
@@ -1462,7 +1462,7 @@ const updateImageResizerPosition = (e, core) => {
|
|
|
1462
1462
|
}
|
|
1463
1463
|
|
|
1464
1464
|
const destroyImageResizer = (options, core) => {
|
|
1465
|
-
changeAllToolbarState(core, 'enabled')
|
|
1465
|
+
if (!options.disabled) changeAllToolbarState(core, 'enabled')
|
|
1466
1466
|
if (core.elements.resizerPlugin) core.elements.toolbarContainer.removeChild(core.elements.resizerPlugin)
|
|
1467
1467
|
if (core.elements.resizer) core.elements.iframeWindow.body.removeChild(core.elements.resizer)
|
|
1468
1468
|
core.elements.iframeWindow.removeEventListener('scroll', core.resizerHandler, false)
|