@innovastudio/contentbox 1.6.77 → 1.6.78
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -9025,7 +9025,7 @@ class Text {
|
|
9025
9025
|
const config = this.builder.cssClasses;
|
9026
9026
|
let activeElement = this.builder.controlpanel.activeElement;
|
9027
9027
|
|
9028
|
-
if (activeElement.tagName.toLowerCase() === 'div' && (activeElement.classList.contains(
|
9028
|
+
if (activeElement.tagName.toLowerCase() === 'div' && (activeElement.classList.contains(config.textAlign.left) || activeElement.classList.contains(config.textAlign.center) || activeElement.classList.contains(config.textAlign.right) || activeElement.classList.contains(config.textAlign.justify))) {
|
9029
9029
|
// div with icon or svg inside
|
9030
9030
|
let elm = activeElement;
|
9031
9031
|
elm.classList.remove(config.textAlign.left);
|
@@ -11275,13 +11275,14 @@ class PanelText {
|
|
11275
11275
|
const blocks = this.text.getSelectedBlocks(true);
|
11276
11276
|
|
11277
11277
|
if (blocks.length === 1) {
|
11278
|
+
const config = this.builder.cssClasses;
|
11278
11279
|
this.panel.querySelectorAll('[data-align]').forEach(elm => elm.classList.remove('on'));
|
11279
11280
|
|
11280
|
-
if (activeElement.classList.contains(
|
11281
|
+
if (activeElement.classList.contains(config.textAlign.left)) {
|
11281
11282
|
this.panel.querySelector('button[data-align=left]').classList.add('on');
|
11282
|
-
} else if (activeElement.classList.contains(
|
11283
|
+
} else if (activeElement.classList.contains(config.textAlign.center)) {
|
11283
11284
|
this.panel.querySelector('button[data-align=center]').classList.add('on');
|
11284
|
-
} else if (activeElement.classList.contains(
|
11285
|
+
} else if (activeElement.classList.contains(config.textAlign.right)) {
|
11285
11286
|
this.panel.querySelector('button[data-align=right]').classList.add('on');
|
11286
11287
|
}
|
11287
11288
|
}
|
@@ -25662,7 +25663,7 @@ class ControlPanel {
|
|
25662
25663
|
}
|
25663
25664
|
}
|
25664
25665
|
|
25665
|
-
open_() {
|
25666
|
+
open_(what) {
|
25666
25667
|
const viewportWidth = document.documentElement.clientWidth;
|
25667
25668
|
|
25668
25669
|
if (viewportWidth <= 1322) {
|
@@ -25683,8 +25684,13 @@ class ControlPanel {
|
|
25683
25684
|
}, 300);
|
25684
25685
|
this.getActive(); // Show/hide panel
|
25685
25686
|
|
25686
|
-
if (
|
25687
|
-
|
25687
|
+
if (what) {
|
25688
|
+
this.select(what);
|
25689
|
+
} else {
|
25690
|
+
if (this.activeElement) this.select('element');else if (this.activeBlock) this.select('block'); // freeform
|
25691
|
+
else if (!this.activeElement && !this.activeColumn && !this.activeRow && this.activeBox) this.select('box');else this.select('');
|
25692
|
+
}
|
25693
|
+
|
25688
25694
|
this.repositionTool(); // Sync with external buttons
|
25689
25695
|
|
25690
25696
|
let btns = document.querySelectorAll('[data-state="togglepanel"]');
|
@@ -26099,7 +26105,7 @@ class ControlPanel {
|
|
26099
26105
|
|
26100
26106
|
if (what === 'element' || what === 'column' || what === 'row' || what === 'box' || what === 'section') {
|
26101
26107
|
if (document.body.classList.contains('controlpanel')) ; else {
|
26102
|
-
this.open_(); // Force open
|
26108
|
+
this.open_(what); // Force open
|
26103
26109
|
}
|
26104
26110
|
}
|
26105
26111
|
|