@innovastudio/contentbox 1.4.13 → 1.4.14
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/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@innovastudio/contentbox",
|
3
3
|
"type": "module",
|
4
|
-
"version": "1.4.
|
4
|
+
"version": "1.4.14",
|
5
5
|
"description": "",
|
6
6
|
"main": "public/contentbox/contentbox.esm.js",
|
7
7
|
"files": [
|
@@ -46,7 +46,7 @@
|
|
46
46
|
"webpack-dev-server": "^4.0.0"
|
47
47
|
},
|
48
48
|
"dependencies": {
|
49
|
-
"@innovastudio/contentbuilder": "^1.3.
|
49
|
+
"@innovastudio/contentbuilder": "^1.3.12",
|
50
50
|
"js-beautify": "^1.14.0"
|
51
51
|
}
|
52
52
|
}
|
@@ -10024,7 +10024,7 @@ class EditBox {
|
|
10024
10024
|
if (val === '20') dom$j.addClass(container, 'size-20');
|
10025
10025
|
if (val === '21') dom$j.addClass(container, 'size-21'); // cleanup
|
10026
10026
|
|
10027
|
-
const paragraphs = container.querySelectorAll('p');
|
10027
|
+
const paragraphs = container.querySelectorAll('p,li,td,label');
|
10028
10028
|
paragraphs.forEach(p => {
|
10029
10029
|
if (val === '16') if (dom$j.hasClass(p, 'size-16')) dom$j.removeClass(p, 'size-16');
|
10030
10030
|
if (val === '17') if (dom$j.hasClass(p, 'size-17')) dom$j.removeClass(p, 'size-17');
|
@@ -10073,7 +10073,7 @@ class EditBox {
|
|
10073
10073
|
if (val === '1.9') dom$j.addClass(container, 'leading-19');
|
10074
10074
|
if (val === '2') dom$j.addClass(container, 'leading-20'); // cleanup
|
10075
10075
|
|
10076
|
-
const paragraphs = container.querySelectorAll('p');
|
10076
|
+
const paragraphs = container.querySelectorAll('p,li,td,label');
|
10077
10077
|
paragraphs.forEach(p => {
|
10078
10078
|
if (val === '1') if (dom$j.hasClass(p, 'leading-none')) dom$j.removeClass(p, 'leading-none');
|
10079
10079
|
if (val === '1.1') if (dom$j.hasClass(p, 'leading-11')) dom$j.removeClass(p, 'leading-11');
|
@@ -11340,6 +11340,7 @@ class EditBox {
|
|
11340
11340
|
const overlayBg = activeBox.querySelector('.is-overlay-bg');
|
11341
11341
|
const overlayVideo = activeBox.querySelector('.is-video-bg');
|
11342
11342
|
const overlayContent = activeBox.querySelector('.is-overlay-content');
|
11343
|
+
const container = activeBox.querySelector('.is-builder');
|
11343
11344
|
let overlayBgHasContent = false;
|
11344
11345
|
|
11345
11346
|
if (overlayBg) {
|
@@ -11410,7 +11411,6 @@ class EditBox {
|
|
11410
11411
|
vPos = 'bottom';
|
11411
11412
|
}
|
11412
11413
|
|
11413
|
-
const container = activeBox.querySelector('.is-builder');
|
11414
11414
|
let hPos = 'center';
|
11415
11415
|
|
11416
11416
|
if (container) {
|
@@ -11882,6 +11882,18 @@ class EditBox {
|
|
11882
11882
|
divContentJustify.style.display = 'none';
|
11883
11883
|
}
|
11884
11884
|
}
|
11885
|
+
|
11886
|
+
if (modalEditBox.querySelector('#divBoxImage').style.display === 'flex' && modalEditBox.querySelector('#tabBoxImage').style.display === 'none') {
|
11887
|
+
modalEditBox.querySelector('#tabBoxGeneral').click();
|
11888
|
+
}
|
11889
|
+
|
11890
|
+
if (modalEditBox.querySelector('#divBoxContentText').style.display === 'flex' && modalEditBox.querySelector('#tabBoxContentText').style.display === 'none') {
|
11891
|
+
modalEditBox.querySelector('#tabBoxGeneral').click();
|
11892
|
+
}
|
11893
|
+
|
11894
|
+
if (modalEditBox.querySelector('#divBoxContentContainer').style.display === 'flex' && modalEditBox.querySelector('#tabBoxContentContainer').style.display === 'none') {
|
11895
|
+
modalEditBox.querySelector('#tabBoxGeneral').click();
|
11896
|
+
}
|
11885
11897
|
} //edit
|
11886
11898
|
|
11887
11899
|
|
@@ -27235,6 +27247,7 @@ class HtmlUtil {
|
|
27235
27247
|
automaticLayout: true,
|
27236
27248
|
contextmenu: false,
|
27237
27249
|
fontSize: 13,
|
27250
|
+
wordWrap: true,
|
27238
27251
|
scrollbar: {
|
27239
27252
|
useShadows: false,
|
27240
27253
|
vertical: 'visible',
|
@@ -27307,6 +27320,7 @@ class HtmlUtil {
|
|
27307
27320
|
automaticLayout: true,
|
27308
27321
|
contextmenu: false,
|
27309
27322
|
fontSize: 13,
|
27323
|
+
wordWrap: true,
|
27310
27324
|
scrollbar: {
|
27311
27325
|
useShadows: false,
|
27312
27326
|
vertical: 'visible',
|
@@ -78536,7 +78550,7 @@ class Rte {
|
|
78536
78550
|
<div class="rte-color-picker-area"></div>
|
78537
78551
|
</div>
|
78538
78552
|
|
78539
|
-
<div class="rte-textsetting-options is-rte-pop" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
|
78553
|
+
<div class="rte-textsetting-options ${this.builder.simpleTextSettings ? 'simple' : ''} is-rte-pop" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
|
78540
78554
|
<div>
|
78541
78555
|
<div class="is-label">${util.out('Font Size')}</div>
|
78542
78556
|
<div class="rte-fontsize-options" style="display: flex;flex-flow: wrap;">
|
@@ -78546,6 +78560,19 @@ class Rte {
|
|
78546
78560
|
<button title="${util.out('Increase')}" data-value="+" style="font-size:13px">+</button>
|
78547
78561
|
<button title="${util.out('Clear')}" data-value=""><svg class="is-icon-flex" style="width:18px;height:18px;margin-top: 2px;"><use xlink:href="#ion-ios-close-empty"></use></svg></button>
|
78548
78562
|
</div>
|
78563
|
+
<div class="is-label separator label-fontweight">${util.out('Font Weight')}</div>
|
78564
|
+
<div class="rte-fontweight-options" style="display: flex;flex-flow: wrap;">
|
78565
|
+
<button title="100" data-value="100">100</button>
|
78566
|
+
<button title="200" data-value="200">200</button>
|
78567
|
+
<button title="300" data-value="300">300</button>
|
78568
|
+
<button title="400" data-value="400">400</button>
|
78569
|
+
<button title="500" data-value="500">500</button>
|
78570
|
+
<button title="600" data-value="600">600</button>
|
78571
|
+
<button title="700" data-value="700">700</button>
|
78572
|
+
<button title="800" data-value="800">800</button>
|
78573
|
+
<button title="900" data-value="900">900</button>
|
78574
|
+
<button title="${util.out('Clear')}" data-value=""><svg class="is-icon-flex" style="width:18px;height:18px;margin-top: 2px;"><use xlink:href="#ion-ios-close-empty"></use></svg></button>
|
78575
|
+
</div>
|
78549
78576
|
<div class="is-label separator">${util.out('Line Spacing')}</div>
|
78550
78577
|
<div class="rte-lineheight-options" style="display: flex;flex-flow: wrap;">
|
78551
78578
|
<button title="1" data-value="1">1</button>
|
@@ -79716,82 +79743,7 @@ class Rte {
|
|
79716
79743
|
const h = pop.offsetHeight;
|
79717
79744
|
|
79718
79745
|
if (!dom.hasClass(pop, 'active')) {
|
79719
|
-
|
79720
|
-
const elm = this.builder.activeElement;
|
79721
|
-
let btns = pop.querySelectorAll('.rte-fontsize-options button');
|
79722
|
-
Array.prototype.forEach.call(btns, btn => {
|
79723
|
-
btn.classList.remove('on'); // clear selection
|
79724
|
-
});
|
79725
|
-
const arrSizes = this.builder.opts.fontSizeClassValues;
|
79726
|
-
|
79727
|
-
for (var i = 0; i <= arrSizes.length - 1; i++) {
|
79728
|
-
if (dom.hasClass(elm, 'size-' + arrSizes[i])) {
|
79729
|
-
// Get current class
|
79730
|
-
const btns = pop.querySelectorAll('.rte-fontsize-options button');
|
79731
|
-
Array.prototype.forEach.call(btns, btn => {
|
79732
|
-
let num = btn.getAttribute('data-value');
|
79733
|
-
|
79734
|
-
if (parseInt(num) === arrSizes[i]) {
|
79735
|
-
btn.classList.add('on');
|
79736
|
-
}
|
79737
|
-
});
|
79738
|
-
}
|
79739
|
-
}
|
79740
|
-
|
79741
|
-
btns = pop.querySelectorAll('.rte-lineheight-options button');
|
79742
|
-
Array.prototype.forEach.call(btns, btn => {
|
79743
|
-
btn.classList.remove('on'); // clear selection
|
79744
|
-
});
|
79745
|
-
let classes = this.builder.cssClasses.leading;
|
79746
|
-
|
79747
|
-
for (let i = 0; i < Object.keys(classes).length; i++) {
|
79748
|
-
let className = Object.values(classes)[i];
|
79749
|
-
|
79750
|
-
if (dom.hasClass(elm, className)) {
|
79751
|
-
const btns = pop.querySelectorAll('.rte-lineheight-options button');
|
79752
|
-
Array.prototype.forEach.call(btns, btn => {
|
79753
|
-
let num = btn.getAttribute('data-value');
|
79754
|
-
let val;
|
79755
|
-
if (className === classes.leading_10) val = '1';
|
79756
|
-
if (className === classes.leading_12) val = '1.2';
|
79757
|
-
if (className === classes.leading_14) val = '1.4';
|
79758
|
-
if (className === classes.leading_16) val = '1.6';
|
79759
|
-
if (className === classes.leading_18) val = '1.8';
|
79760
|
-
if (className === classes.leading_20) val = '2';
|
79761
|
-
if (className === classes.leading_22) val = '2.2';
|
79762
|
-
|
79763
|
-
if (num === val) {
|
79764
|
-
btn.classList.add('on');
|
79765
|
-
}
|
79766
|
-
});
|
79767
|
-
}
|
79768
|
-
}
|
79769
|
-
|
79770
|
-
btns = pop.querySelectorAll('.rte-letterspacing-options button');
|
79771
|
-
Array.prototype.forEach.call(btns, btn => {
|
79772
|
-
btn.classList.remove('on'); // clear selection
|
79773
|
-
});
|
79774
|
-
classes = this.builder.cssClasses.tracking;
|
79775
|
-
|
79776
|
-
for (let i = 0; i < Object.keys(classes).length; i++) {
|
79777
|
-
let className = Object.values(classes)[i];
|
79778
|
-
|
79779
|
-
if (dom.hasClass(elm, className)) {
|
79780
|
-
const btns = pop.querySelectorAll('.rte-letterspacing-options button');
|
79781
|
-
Array.prototype.forEach.call(btns, btn => {
|
79782
|
-
let num = btn.getAttribute('data-value');
|
79783
|
-
let val;
|
79784
|
-
if (className === classes.tracking_025) val = '1';
|
79785
|
-
if (className === classes.tracking_050) val = '2';
|
79786
|
-
|
79787
|
-
if (num === val) {
|
79788
|
-
btn.classList.add('on');
|
79789
|
-
}
|
79790
|
-
});
|
79791
|
-
}
|
79792
|
-
} // /Get realtime status
|
79793
|
-
|
79794
|
-
|
79746
|
+
this.getTextSettingsState();
|
79795
79747
|
this.util.showRtePop(pop, () => {
|
79796
79748
|
if (this.builder.opts.toolbar === 'left') {
|
79797
79749
|
pop.style.top = top - h / 2 + 20 + 'px';
|
@@ -80590,15 +80542,47 @@ class Rte {
|
|
80590
80542
|
}
|
80591
80543
|
}); //save selection
|
80592
80544
|
|
80593
|
-
util.saveSelection();
|
80594
|
-
|
80545
|
+
util.saveSelection(); // this.getState();
|
80546
|
+
|
80547
|
+
this.getTextSettingsState(); //Trigger Change event
|
80595
80548
|
|
80596
80549
|
this.builder.opts.onChange(); // if(this.builder.isTouchSupport) { //prevent keyboard open
|
80597
80550
|
// const btnFocus = this.rteTool.querySelector('button');
|
80598
80551
|
// btnFocus.focus();
|
80599
80552
|
// }
|
80553
|
+
// btn.focus();
|
80554
|
+
});
|
80555
|
+
}); // Font Weight (new execCommand)
|
80600
80556
|
|
80601
|
-
|
80557
|
+
btns = rteTextSettingOptions.querySelectorAll('.rte-fontweight-options button');
|
80558
|
+
Array.prototype.forEach.call(btns, btn => {
|
80559
|
+
dom.addEventListener(btn, 'click', () => {
|
80560
|
+
// old 9135
|
80561
|
+
let num = btn.getAttribute('data-value');
|
80562
|
+
util.restoreSelection(); //a must
|
80563
|
+
|
80564
|
+
this.builder.uo.saveForUndo();
|
80565
|
+
const btns = rteTextSettingOptions.querySelectorAll('.rte-fontweight-options button');
|
80566
|
+
Array.prototype.forEach.call(btns, btn => {
|
80567
|
+
btn.classList.remove('on'); // clear selection
|
80568
|
+
});
|
80569
|
+
dom.execCommand('font-weight', num, (ok, container) => {
|
80570
|
+
if (this.builder.useCssClasses) {
|
80571
|
+
if (container) {
|
80572
|
+
this.applyClassFontWeight(container, num);
|
80573
|
+
}
|
80574
|
+
}
|
80575
|
+
}); //save selection
|
80576
|
+
|
80577
|
+
util.saveSelection();
|
80578
|
+
this.getState();
|
80579
|
+
this.getTextSettingsState(); //Trigger Change event
|
80580
|
+
|
80581
|
+
this.builder.opts.onChange(); // if(this.builder.isTouchSupport) { //prevent keyboard open
|
80582
|
+
// const btnFocus = this.rteTool.querySelector('button');
|
80583
|
+
// btnFocus.focus();
|
80584
|
+
// }
|
80585
|
+
// btn.focus();
|
80602
80586
|
});
|
80603
80587
|
}); // Line Height
|
80604
80588
|
|
@@ -80674,6 +80658,9 @@ class Rte {
|
|
80674
80658
|
}
|
80675
80659
|
}
|
80676
80660
|
|
80661
|
+
const elm = dom.getParentBlock(container);
|
80662
|
+
if (elm) elm.style.lineHeight = ''; // Clean inline style
|
80663
|
+
|
80677
80664
|
dom.execCommandClass(newClassName, classes, true, 'block');
|
80678
80665
|
} else {
|
80679
80666
|
let elm;
|
@@ -80775,15 +80762,15 @@ class Rte {
|
|
80775
80762
|
} //save selection
|
80776
80763
|
|
80777
80764
|
|
80778
|
-
util.saveSelection();
|
80779
|
-
|
80765
|
+
util.saveSelection(); // this.getState();
|
80766
|
+
|
80767
|
+
this.getTextSettingsState(); //Trigger Change event
|
80780
80768
|
|
80781
80769
|
this.builder.opts.onChange(); // if(this.builder.isTouchSupport) { //prevent keyboard open
|
80782
80770
|
// const btnFocus = this.rteTool.querySelector('button');
|
80783
80771
|
// btnFocus.focus();
|
80784
80772
|
// }
|
80785
|
-
|
80786
|
-
btn.focus();
|
80773
|
+
// btn.focus();
|
80787
80774
|
});
|
80788
80775
|
}); // Letter Spacing
|
80789
80776
|
|
@@ -80852,6 +80839,8 @@ class Rte {
|
|
80852
80839
|
}
|
80853
80840
|
|
80854
80841
|
if (this.builder.activeElement) this.builder.activeElement.style.letterSpacing = '';
|
80842
|
+
container.style.letterSpacing = ''; // Clean inline style
|
80843
|
+
|
80855
80844
|
if (newClassName === classes.tracking_000) newClassName = ''; // clear for normal tracking
|
80856
80845
|
|
80857
80846
|
dom.execCommandClass(newClassName, classes);
|
@@ -80911,15 +80900,15 @@ class Rte {
|
|
80911
80900
|
} //save selection
|
80912
80901
|
|
80913
80902
|
|
80914
|
-
util.saveSelection();
|
80915
|
-
|
80903
|
+
util.saveSelection(); // this.getState();
|
80904
|
+
|
80905
|
+
this.getTextSettingsState(); //Trigger Change event
|
80916
80906
|
|
80917
80907
|
this.builder.opts.onChange(); // if(this.builder.isTouchSupport) { //prevent keyboard open
|
80918
80908
|
// const btnFocus = this.rteTool.querySelector('button');
|
80919
80909
|
// btnFocus.focus();
|
80920
80910
|
// }
|
80921
|
-
|
80922
|
-
btn.focus();
|
80911
|
+
// btn.focus();
|
80923
80912
|
});
|
80924
80913
|
}); // -----------------------------
|
80925
80914
|
// Click anywhere will hide Column tool
|
@@ -81350,6 +81339,45 @@ class Rte {
|
|
81350
81339
|
dom.cleanClassSize(elm, classname); // dom.cleanUnusedSpan(elm); // will remove empty spans that makes selection changes
|
81351
81340
|
}
|
81352
81341
|
|
81342
|
+
applyClassFontWeight(elm, num) {
|
81343
|
+
const dom = this.dom;
|
81344
|
+
let classes = this.builder.cssClasses.fontWeight;
|
81345
|
+
|
81346
|
+
for (let i = 0; i < Object.keys(classes).length; i++) {
|
81347
|
+
let className = Object.values(classes)[i];
|
81348
|
+
|
81349
|
+
if (dom.hasClass(elm, className)) {
|
81350
|
+
dom.removeClass(elm, className);
|
81351
|
+
}
|
81352
|
+
|
81353
|
+
dom.doFunction(elm, theEl => {
|
81354
|
+
if (dom.hasClass(theEl, className)) {
|
81355
|
+
dom.removeClass(theEl, className);
|
81356
|
+
}
|
81357
|
+
}, true);
|
81358
|
+
}
|
81359
|
+
|
81360
|
+
let classname = '';
|
81361
|
+
if (num === '100') classname = this.builder.cssClasses.fontWeight.thin;
|
81362
|
+
if (num === '200') classname = this.builder.cssClasses.fontWeight.extralight;
|
81363
|
+
if (num === '300') classname = this.builder.cssClasses.fontWeight.light;
|
81364
|
+
if (num === '400') classname = this.builder.cssClasses.fontWeight.normal;
|
81365
|
+
if (num === '500') classname = this.builder.cssClasses.fontWeight.medium;
|
81366
|
+
if (num === '600') classname = this.builder.cssClasses.fontWeight.semibold;
|
81367
|
+
if (num === '700') classname = this.builder.cssClasses.fontWeight.bold;
|
81368
|
+
if (num === '800') classname = this.builder.cssClasses.fontWeight.extrabold;
|
81369
|
+
if (num === '900') classname = this.builder.cssClasses.fontWeight.black;
|
81370
|
+
|
81371
|
+
if (classname === '') ; else {
|
81372
|
+
dom.addClass(elm, classname);
|
81373
|
+
}
|
81374
|
+
|
81375
|
+
dom.doFunction(elm, function (theEl) {
|
81376
|
+
theEl.style.fontWeight = '';
|
81377
|
+
}, true);
|
81378
|
+
dom.cleanClassSize(elm, classname); // dom.cleanUnusedSpan(elm); // will remove empty spans that makes selection changes
|
81379
|
+
}
|
81380
|
+
|
81353
81381
|
click(col) {
|
81354
81382
|
const dom = this.dom;
|
81355
81383
|
let elm = this.builder.inspectedElement;
|
@@ -81601,6 +81629,138 @@ class Rte {
|
|
81601
81629
|
}
|
81602
81630
|
}
|
81603
81631
|
|
81632
|
+
getTextSettingsState() {
|
81633
|
+
const dom = this.dom;
|
81634
|
+
const pop = this.rteTextSettingOptions; // Get realtime status
|
81635
|
+
|
81636
|
+
const selection = dom.getSelection();
|
81637
|
+
if (!selection) return;
|
81638
|
+
const anchorNode = selection.anchorNode;
|
81639
|
+
let container;
|
81640
|
+
|
81641
|
+
if (anchorNode) {
|
81642
|
+
container = anchorNode.nodeType !== Node.TEXT_NODE && anchorNode.nodeType !== Node.COMMENT_NODE ? anchorNode : anchorNode.parentElement;
|
81643
|
+
}
|
81644
|
+
|
81645
|
+
let btns = pop.querySelectorAll('.rte-fontsize-options button');
|
81646
|
+
Array.prototype.forEach.call(btns, btn => {
|
81647
|
+
btn.classList.remove('on'); // clear selection
|
81648
|
+
});
|
81649
|
+
|
81650
|
+
if (container) {
|
81651
|
+
const arrSizes = this.builder.opts.fontSizeClassValues;
|
81652
|
+
|
81653
|
+
for (let i = 0; i <= arrSizes.length - 1; i++) {
|
81654
|
+
if (dom.hasClass(container, 'size-' + arrSizes[i])) {
|
81655
|
+
// Get current class
|
81656
|
+
const btns = pop.querySelectorAll('.rte-fontsize-options button');
|
81657
|
+
Array.prototype.forEach.call(btns, btn => {
|
81658
|
+
let num = btn.getAttribute('data-value');
|
81659
|
+
|
81660
|
+
if (parseInt(num) === arrSizes[i]) {
|
81661
|
+
btn.classList.add('on');
|
81662
|
+
}
|
81663
|
+
});
|
81664
|
+
}
|
81665
|
+
}
|
81666
|
+
}
|
81667
|
+
|
81668
|
+
btns = pop.querySelectorAll('.rte-fontweight-options button');
|
81669
|
+
Array.prototype.forEach.call(btns, btn => {
|
81670
|
+
btn.classList.remove('on'); // clear selection
|
81671
|
+
});
|
81672
|
+
|
81673
|
+
if (container) {
|
81674
|
+
let classes = this.builder.cssClasses.fontWeight;
|
81675
|
+
|
81676
|
+
for (let i = 0; i < Object.keys(classes).length; i++) {
|
81677
|
+
let className = Object.values(classes)[i];
|
81678
|
+
|
81679
|
+
if (dom.hasClass(container, className)) {
|
81680
|
+
const btns = pop.querySelectorAll('.rte-fontweight-options button');
|
81681
|
+
Array.prototype.forEach.call(btns, btn => {
|
81682
|
+
let num = btn.getAttribute('data-value');
|
81683
|
+
let val;
|
81684
|
+
if (className === classes.thin) val = '100';
|
81685
|
+
if (className === classes.extralight) val = '200';
|
81686
|
+
if (className === classes.light) val = '300';
|
81687
|
+
if (className === classes.normal) val = '400';
|
81688
|
+
if (className === classes.medium) val = '500';
|
81689
|
+
if (className === classes.semibold) val = '600';
|
81690
|
+
if (className === classes.bold) val = '700';
|
81691
|
+
if (className === classes.extrabold) val = '800';
|
81692
|
+
if (className === classes.black) val = '900';
|
81693
|
+
|
81694
|
+
if (num === val) {
|
81695
|
+
btn.classList.add('on');
|
81696
|
+
}
|
81697
|
+
});
|
81698
|
+
}
|
81699
|
+
}
|
81700
|
+
}
|
81701
|
+
|
81702
|
+
btns = pop.querySelectorAll('.rte-lineheight-options button');
|
81703
|
+
Array.prototype.forEach.call(btns, btn => {
|
81704
|
+
btn.classList.remove('on'); // clear selection
|
81705
|
+
});
|
81706
|
+
const block = dom.getParentBlock(container);
|
81707
|
+
|
81708
|
+
if (block) {
|
81709
|
+
let classes = this.builder.cssClasses.leading;
|
81710
|
+
|
81711
|
+
for (let i = 0; i < Object.keys(classes).length; i++) {
|
81712
|
+
let className = Object.values(classes)[i];
|
81713
|
+
|
81714
|
+
if (dom.hasClass(block, className)) {
|
81715
|
+
const btns = pop.querySelectorAll('.rte-lineheight-options button');
|
81716
|
+
Array.prototype.forEach.call(btns, btn => {
|
81717
|
+
let num = btn.getAttribute('data-value');
|
81718
|
+
let val;
|
81719
|
+
if (className === classes.leading_10) val = '1';
|
81720
|
+
if (className === classes.leading_12) val = '1.2';
|
81721
|
+
if (className === classes.leading_14) val = '1.4';
|
81722
|
+
if (className === classes.leading_16) val = '1.6';
|
81723
|
+
if (className === classes.leading_18) val = '1.8';
|
81724
|
+
if (className === classes.leading_20) val = '2';
|
81725
|
+
if (className === classes.leading_22) val = '2.2';
|
81726
|
+
|
81727
|
+
if (num === val) {
|
81728
|
+
btn.classList.add('on');
|
81729
|
+
}
|
81730
|
+
});
|
81731
|
+
}
|
81732
|
+
}
|
81733
|
+
}
|
81734
|
+
|
81735
|
+
btns = pop.querySelectorAll('.rte-letterspacing-options button');
|
81736
|
+
Array.prototype.forEach.call(btns, btn => {
|
81737
|
+
btn.classList.remove('on'); // clear selection
|
81738
|
+
});
|
81739
|
+
|
81740
|
+
if (container) {
|
81741
|
+
let classes = this.builder.cssClasses.tracking;
|
81742
|
+
|
81743
|
+
for (let i = 0; i < Object.keys(classes).length; i++) {
|
81744
|
+
let className = Object.values(classes)[i];
|
81745
|
+
|
81746
|
+
if (dom.hasClass(container, className)) {
|
81747
|
+
const btns = pop.querySelectorAll('.rte-letterspacing-options button');
|
81748
|
+
Array.prototype.forEach.call(btns, btn => {
|
81749
|
+
let num = btn.getAttribute('data-value');
|
81750
|
+
let val;
|
81751
|
+
if (className === classes.tracking_025) val = '1';
|
81752
|
+
if (className === classes.tracking_050) val = '2';
|
81753
|
+
|
81754
|
+
if (num === val) {
|
81755
|
+
btn.classList.add('on');
|
81756
|
+
}
|
81757
|
+
});
|
81758
|
+
}
|
81759
|
+
}
|
81760
|
+
} // /Get realtime status
|
81761
|
+
|
81762
|
+
}
|
81763
|
+
|
81604
81764
|
getIconsStyle() {
|
81605
81765
|
let css = `
|
81606
81766
|
html, body {height:100%}
|
@@ -86483,7 +86643,8 @@ class ContentBuilder {
|
|
86483
86643
|
},
|
86484
86644
|
useCssClasses: true,
|
86485
86645
|
useButtonPlugin: false,
|
86486
|
-
enableDragResize: true
|
86646
|
+
enableDragResize: true,
|
86647
|
+
simpleTextSettings: true
|
86487
86648
|
}; // obj.preserveSelection = true; (can be set programmatically) to prevent click that clears selection on external custom modal.
|
86488
86649
|
|
86489
86650
|
this.opts = Object.assign(this, defaults, opts);
|