@innovastudio/contentbuilder 1.3.16 → 1.3.18
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
|
@@ -2337,6 +2337,18 @@ button:focus-visible {
|
|
|
2337
2337
|
width: 20px;
|
|
2338
2338
|
height: 20px;
|
|
2339
2339
|
}
|
|
2340
|
+
#_cbhtml .is-modal.buttoneditor #divMyButtons, #_cbhtml .is-modal.buttoneditor #divButtonTemplates,
|
|
2341
|
+
.is-ui .is-modal.buttoneditor #divMyButtons,
|
|
2342
|
+
.is-ui .is-modal.buttoneditor #divButtonTemplates {
|
|
2343
|
+
background-color: #ebebeb;
|
|
2344
|
+
position: absolute;
|
|
2345
|
+
width: 100%;
|
|
2346
|
+
height: 100%;
|
|
2347
|
+
top: 0px;
|
|
2348
|
+
left: 0px;
|
|
2349
|
+
border-top: 80px solid transparent;
|
|
2350
|
+
box-sizing: border-box;
|
|
2351
|
+
}
|
|
2340
2352
|
#_cbhtml .is-modal.buttoneditor #divMyButtonList,
|
|
2341
2353
|
.is-ui .is-modal.buttoneditor #divMyButtonList {
|
|
2342
2354
|
padding: 10px 20px 10px;
|
|
@@ -2345,7 +2357,7 @@ button:focus-visible {
|
|
|
2345
2357
|
position: absolute;
|
|
2346
2358
|
top: 0;
|
|
2347
2359
|
left: 0;
|
|
2348
|
-
border-top: transparent
|
|
2360
|
+
border-top: transparent 70px solid;
|
|
2349
2361
|
box-sizing: border-box;
|
|
2350
2362
|
overflow: hidden;
|
|
2351
2363
|
overflow-y: auto;
|
|
@@ -5743,7 +5743,9 @@ class Util {
|
|
|
5743
5743
|
|
|
5744
5744
|
repositionColumnTool(transition) {
|
|
5745
5745
|
let columnTool = this.builder.colTool.columnTool;
|
|
5746
|
+
if (!columnTool) return;
|
|
5746
5747
|
let col = this.builder.activeCol;
|
|
5748
|
+
if (!col) return;
|
|
5747
5749
|
|
|
5748
5750
|
if (transition) {
|
|
5749
5751
|
columnTool.style.transition = 'all 100ms ease';
|
|
@@ -49302,6 +49304,7 @@ class Image$1 {
|
|
|
49302
49304
|
<button title="3x4" data-crop-size="0.75" style="width: 45px;height: 60px;">3x4</button>
|
|
49303
49305
|
<button title="6x4" data-crop-size="1.5" style="width: 60px;height: 40px;">6x4</button>
|
|
49304
49306
|
<button title="4x6" data-crop-size="0.6666" style="width: 40px;height: 60px;">4x6</button>
|
|
49307
|
+
<button title="16x9" data-crop-size="1.77" style="width: 60px;height: 35px;">16x9</button>
|
|
49305
49308
|
<button title="${util.out('Free')}" data-crop-size="" style="width: 60px;height: 45px;">${util.out('Free')}</button>
|
|
49306
49309
|
</div>
|
|
49307
49310
|
<div class="imageedit-preview" style="max-width:1000px;width:100%;max-height:550px;">
|
|
@@ -50617,7 +50620,7 @@ class ButtonEditor {
|
|
|
50617
50620
|
${util.out('Button')}
|
|
50618
50621
|
<button class="is-modal-close" tabindex="-1" title="${util.out('Close')}">✕</button>
|
|
50619
50622
|
</div>
|
|
50620
|
-
<div style="padding:0">
|
|
50623
|
+
<div style="padding:0;height:100%;">
|
|
50621
50624
|
<div class="is-tabs" data-group="button" style="position:relative;z-index:1">
|
|
50622
50625
|
<a title="${util.out('General')}" href="" data-content="divButtonGeneral" class="active">${util.out('General')}</a>
|
|
50623
50626
|
<a title="${util.out('Hover')}" href="" data-content="divButtonHover">${util.out('Hover')}</a>
|
|
@@ -50924,8 +50927,8 @@ class ButtonEditor {
|
|
|
50924
50927
|
let elm = e.target;
|
|
50925
50928
|
this.builder.colorPicker.open(color => {
|
|
50926
50929
|
const activeButton = this.builder.activeButton || this.builder.activeLinkButton;
|
|
50927
|
-
activeButton.style.backgroundColor = color;
|
|
50928
|
-
|
|
50930
|
+
activeButton.style.backgroundColor = color; // activeButton.setAttribute('data-bg', color);
|
|
50931
|
+
|
|
50929
50932
|
dom.removeClassesByPrefix(activeButton, 'bg-');
|
|
50930
50933
|
elm.style.backgroundColor = color; // preview
|
|
50931
50934
|
//Trigger Change event
|
|
@@ -50989,10 +50992,20 @@ class ButtonEditor {
|
|
|
50989
50992
|
let elm = e.target;
|
|
50990
50993
|
this.builder.colorPicker.open(color => {
|
|
50991
50994
|
const activeButton = this.builder.activeButton || this.builder.activeLinkButton;
|
|
50992
|
-
|
|
50995
|
+
|
|
50996
|
+
if (color === '') {
|
|
50997
|
+
activeButton.removeAttribute('data-bg');
|
|
50998
|
+
activeButton.removeAttribute('data-hover-bg');
|
|
50999
|
+
activeButton.removeAttribute('onmouseover');
|
|
51000
|
+
activeButton.removeAttribute('onmouseout');
|
|
51001
|
+
} else {
|
|
51002
|
+
activeButton.setAttribute('data-bg', activeButton.style.backgroundColor);
|
|
51003
|
+
activeButton.setAttribute('data-hover-bg', color);
|
|
51004
|
+
activeButton.setAttribute('onmouseover', 'if(this.getAttribute(\'data-hover-bg\'))this.style.backgroundColor=this.getAttribute(\'data-hover-bg\');');
|
|
51005
|
+
activeButton.setAttribute('onmouseout', 'if(this.getAttribute(\'data-bg\'))this.style.backgroundColor=this.getAttribute(\'data-bg\');else this.style.backgroundColor=\'\'');
|
|
51006
|
+
}
|
|
51007
|
+
|
|
50993
51008
|
dom.removeClassesByPrefix(activeButton, 'hover:bg-');
|
|
50994
|
-
activeButton.setAttribute('onmouseover', 'if(this.getAttribute(\'data-hover-bg\'))this.style.backgroundColor=this.getAttribute(\'data-hover-bg\');');
|
|
50995
|
-
activeButton.setAttribute('onmouseout', 'if(this.getAttribute(\'data-bg\'))this.style.backgroundColor=this.getAttribute(\'data-bg\');else this.style.backgroundColor=\'\'');
|
|
50996
51009
|
elm.style.backgroundColor = color; // preview
|
|
50997
51010
|
//Trigger Change event
|
|
50998
51011
|
|
|
@@ -51449,15 +51462,20 @@ class ButtonEditor {
|
|
|
51449
51462
|
|
|
51450
51463
|
dom.removeClass(activeButton, 'active');
|
|
51451
51464
|
dom.removeClass(activeButton, 'elm-active');
|
|
51452
|
-
|
|
51453
|
-
|
|
51454
|
-
|
|
51465
|
+
let dataBg = activeButton.getAttribute('data-bg'); // if(!dataBg) {
|
|
51466
|
+
// if(activeButton.style.backgroundColor) dataBg=activeButton.style.backgroundColor;
|
|
51467
|
+
// }
|
|
51468
|
+
|
|
51469
|
+
const dataHoverBg = activeButton.getAttribute('data-hover-bg'); // const color = activeButton.style.color;
|
|
51470
|
+
|
|
51471
|
+
const cssText = activeButton.style.cssText;
|
|
51455
51472
|
mybuttons.push({
|
|
51456
51473
|
id: mybuttons.length,
|
|
51457
51474
|
className: activeButton.className,
|
|
51458
51475
|
bg: dataBg ? dataBg : '',
|
|
51459
51476
|
hoverBg: dataHoverBg ? dataHoverBg : '',
|
|
51460
|
-
color: color
|
|
51477
|
+
// color: color?color:'',
|
|
51478
|
+
cssText: cssText
|
|
51461
51479
|
});
|
|
51462
51480
|
localStorage.setItem('_savedbuttons', JSON.stringify(mybuttons));
|
|
51463
51481
|
this.renderMyButtons();
|
|
@@ -51492,6 +51510,14 @@ class ButtonEditor {
|
|
|
51492
51510
|
this.getVisibleBgColor(item.replace('hover:', ''), color => {
|
|
51493
51511
|
btnHoverBgColor.style.backgroundColor = color;
|
|
51494
51512
|
activeButton.setAttribute('data-hover-bg', color); //new inline
|
|
51513
|
+
|
|
51514
|
+
if (!activeButton.hasAttribute('data-bg')) {
|
|
51515
|
+
// fix needed data-bg
|
|
51516
|
+
activeButton.setAttribute('data-bg', btnBgColor.style.backgroundColor); // needed by hover
|
|
51517
|
+
}
|
|
51518
|
+
|
|
51519
|
+
activeButton.setAttribute('onmouseover', 'if(this.getAttribute(\'data-hover-bg\'))this.style.backgroundColor=this.getAttribute(\'data-hover-bg\');');
|
|
51520
|
+
activeButton.setAttribute('onmouseout', 'if(this.getAttribute(\'data-bg\'))this.style.backgroundColor=this.getAttribute(\'data-bg\');else this.style.backgroundColor=\'\'');
|
|
51495
51521
|
});
|
|
51496
51522
|
}
|
|
51497
51523
|
|
|
@@ -51518,7 +51544,13 @@ class ButtonEditor {
|
|
|
51518
51544
|
} // NEW: inline color
|
|
51519
51545
|
|
|
51520
51546
|
|
|
51521
|
-
if (activeButton.
|
|
51547
|
+
if (activeButton.hasAttribute('data-bg')) {
|
|
51548
|
+
btnBgColor.style.backgroundColor = activeButton.getAttribute('data-bg');
|
|
51549
|
+
} else {
|
|
51550
|
+
if (activeButton.style.backgroundColor) {
|
|
51551
|
+
btnBgColor.style.backgroundColor = activeButton.style.backgroundColor;
|
|
51552
|
+
}
|
|
51553
|
+
}
|
|
51522
51554
|
|
|
51523
51555
|
if (activeButton.getAttribute('data-hover-bg')) btnHoverBgColor.style.backgroundColor = activeButton.getAttribute('data-hover-bg');
|
|
51524
51556
|
if (activeButton.style.color) btnTextColor.style.backgroundColor = activeButton.style.color;
|
|
@@ -51716,7 +51748,95 @@ class ButtonEditor {
|
|
|
51716
51748
|
}
|
|
51717
51749
|
|
|
51718
51750
|
renderTemplates() {
|
|
51719
|
-
const templates = [
|
|
51751
|
+
const templates = [
|
|
51752
|
+
/* rounded */
|
|
51753
|
+
{
|
|
51754
|
+
html: `
|
|
51755
|
+
<a href="#" role="button" class="transition-all inline-block cursor-pointer no-underline border-2 border-solid mr-1 mt-1 uppercase py-2 size-14 px-8 border-current hover:border-current font-normal leading-relaxed rounded-full tracking-125">Read More</a>
|
|
51756
|
+
`
|
|
51757
|
+
}, {
|
|
51758
|
+
html: `
|
|
51759
|
+
<a href="#" role="button" class="transition-all inline-block cursor-pointer no-underline border-2 border-solid mr-1 mt-1 uppercase py-2 size-14 px-8 text-black leading-relaxed rounded-full border-transparent hover:border-transparent font-normal tracking-125" style="background-color: rgb(240, 240, 240);">Get Started</a>
|
|
51760
|
+
`
|
|
51761
|
+
}, {
|
|
51762
|
+
html: `
|
|
51763
|
+
<a href="#" role="button" class="transition-all inline-block cursor-pointer no-underline border-2 border-solid mr-1 py-2 px-8 font-normal leading-relaxed border-transparent rounded-full ml-0 mt-1 size-14 tracking-125 hover:border-transparent uppercase" style="color: rgb(255, 255, 255); background-color: rgb(255, 127, 0);">Get Started</a>
|
|
51764
|
+
`
|
|
51765
|
+
}, {
|
|
51766
|
+
html: `
|
|
51767
|
+
<a href="#" role="button" class="transition-all inline-block cursor-pointer no-underline border-2 border-solid mr-1 py-2 px-8 font-normal leading-relaxed border-transparent rounded-full ml-0 mt-1 size-14 tracking-125 hover:border-transparent uppercase" style="color: rgb(255, 255, 255); background-color: rgb(83,98,208);">Get Started</a>
|
|
51768
|
+
`
|
|
51769
|
+
}, {
|
|
51770
|
+
html: `
|
|
51771
|
+
<a href="#" role="button" class="transition-all inline-block cursor-pointer no-underline border-2 border-solid mr-1 py-2 px-8 font-normal leading-relaxed border-transparent rounded-full ml-0 mt-1 size-14 tracking-125 hover:border-transparent uppercase" style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">Get Started</a>
|
|
51772
|
+
`
|
|
51773
|
+
}, {
|
|
51774
|
+
html: `
|
|
51775
|
+
<a href="#" role="button" class="transition-all inline-block cursor-pointer no-underline border-2 border-solid mr-1 mt-1 uppercase py-2 size-14 px-8 border-current hover:border-current font-normal leading-relaxed tracking-125 rounded-full" style="color: rgb(255, 255, 255);">Get Started</a>
|
|
51776
|
+
`
|
|
51777
|
+
},
|
|
51778
|
+
/* colors */
|
|
51779
|
+
{
|
|
51780
|
+
html: `
|
|
51781
|
+
<a href="#" role="button" class="transition-all inline-block cursor-pointer no-underline border-2 border-solid mr-1 py-2 px-8 font-normal leading-relaxed border-transparent rounded-full ml-0 mt-1 size-14 tracking-125 hover:border-transparent uppercase" style="color: rgb(255, 255, 255); background-color: rgb(0, 200, 218);">Get Started</a>
|
|
51782
|
+
`
|
|
51783
|
+
}, {
|
|
51784
|
+
html: `
|
|
51785
|
+
<a href="#" role="button" class="transition-all inline-block cursor-pointer no-underline border-2 border-solid mr-1 py-2 px-8 font-normal leading-relaxed border-transparent rounded-full ml-0 mt-1 size-14 tracking-125 hover:border-transparent uppercase" style="color: rgb(255, 255, 255); background-color: rgb(55, 148, 59);">Get Started</a>
|
|
51786
|
+
`
|
|
51787
|
+
}, {
|
|
51788
|
+
html: `
|
|
51789
|
+
<a href="#" role="button" class="transition-all inline-block cursor-pointer no-underline border-2 border-solid mr-1 py-2 px-8 font-normal leading-relaxed border-transparent rounded-full ml-0 mt-1 size-14 tracking-125 hover:border-transparent uppercase" style="color: rgb(255, 255, 255); background-color: rgb(233,2,0);">Get Started</a>
|
|
51790
|
+
`
|
|
51791
|
+
}, {
|
|
51792
|
+
html: `
|
|
51793
|
+
<a href="#" role="button" class="transition-all inline-block cursor-pointer no-underline border-2 border-solid mr-1 py-2 px-8 font-normal leading-relaxed border-transparent rounded-full ml-0 mt-1 size-14 tracking-125 hover:border-transparent uppercase" style="color: rgb(0, 0, 0); background-color: rgb(254, 222, 76);">Get Started</a>
|
|
51794
|
+
`
|
|
51795
|
+
},
|
|
51796
|
+
/* square */
|
|
51797
|
+
{
|
|
51798
|
+
html: `
|
|
51799
|
+
<a href="#" role="button" class="transition-all inline-block cursor-pointer no-underline border-2 border-solid mr-1 mt-1 uppercase py-2 size-14 px-8 border-current hover:border-current font-normal leading-relaxed rounded tracking-125">Read More</a>
|
|
51800
|
+
`
|
|
51801
|
+
}, {
|
|
51802
|
+
html: `
|
|
51803
|
+
<a href="#" role="button" class="transition-all inline-block cursor-pointer no-underline border-2 border-solid mr-1 mt-1 uppercase py-2 size-14 px-8 text-black leading-relaxed rounded border-transparent hover:border-transparent font-normal tracking-125" style="background-color: rgb(240, 240, 240);">Get Started</a>
|
|
51804
|
+
`
|
|
51805
|
+
}, {
|
|
51806
|
+
html: `
|
|
51807
|
+
<a href="#" role="button" class="transition-all inline-block cursor-pointer no-underline border-2 border-solid mr-1 py-2 px-8 font-normal leading-relaxed border-transparent rounded ml-0 mt-1 size-14 tracking-125 hover:border-transparent uppercase" style="color: rgb(255, 255, 255); background-color: rgb(255, 127, 0);">Get Started</a>
|
|
51808
|
+
`
|
|
51809
|
+
}, {
|
|
51810
|
+
html: `
|
|
51811
|
+
<a href="#" role="button" class="transition-all inline-block cursor-pointer no-underline border-2 border-solid mr-1 py-2 px-8 font-normal leading-relaxed border-transparent rounded ml-0 mt-1 size-14 tracking-125 hover:border-transparent uppercase" style="color: rgb(255, 255, 255); background-color: rgb(83,98,208);">Get Started</a>
|
|
51812
|
+
`
|
|
51813
|
+
}, {
|
|
51814
|
+
html: `
|
|
51815
|
+
<a href="#" role="button" class="transition-all inline-block cursor-pointer no-underline border-2 border-solid mr-1 py-2 px-8 font-normal leading-relaxed border-transparent rounded ml-0 mt-1 size-14 tracking-125 hover:border-transparent uppercase" style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">Get Started</a>
|
|
51816
|
+
`
|
|
51817
|
+
}, {
|
|
51818
|
+
html: `
|
|
51819
|
+
<a href="#" role="button" class="transition-all inline-block cursor-pointer no-underline border-2 border-solid mr-1 mt-1 uppercase py-2 size-14 px-8 border-current hover:border-current font-normal leading-relaxed tracking-125 rounded" style="color: rgb(255, 255, 255);">Get Started</a>
|
|
51820
|
+
`
|
|
51821
|
+
},
|
|
51822
|
+
/* colors */
|
|
51823
|
+
{
|
|
51824
|
+
html: `
|
|
51825
|
+
<a href="#" role="button" class="transition-all inline-block cursor-pointer no-underline border-2 border-solid mr-1 py-2 px-8 font-normal leading-relaxed border-transparent rounded ml-0 mt-1 size-14 tracking-125 hover:border-transparent uppercase" style="color: rgb(255, 255, 255); background-color: rgb(0, 200, 218);">Get Started</a>
|
|
51826
|
+
`
|
|
51827
|
+
}, {
|
|
51828
|
+
html: `
|
|
51829
|
+
<a href="#" role="button" class="transition-all inline-block cursor-pointer no-underline border-2 border-solid mr-1 py-2 px-8 font-normal leading-relaxed border-transparent rounded ml-0 mt-1 size-14 tracking-125 hover:border-transparent uppercase" style="color: rgb(255, 255, 255); background-color: rgb(55, 148, 59);">Get Started</a>
|
|
51830
|
+
`
|
|
51831
|
+
}, {
|
|
51832
|
+
html: `
|
|
51833
|
+
<a href="#" role="button" class="transition-all inline-block cursor-pointer no-underline border-2 border-solid mr-1 py-2 px-8 font-normal leading-relaxed border-transparent rounded ml-0 mt-1 size-14 tracking-125 hover:border-transparent uppercase" style="color: rgb(255, 255, 255); background-color: rgb(233,2,0);">Get Started</a>
|
|
51834
|
+
`
|
|
51835
|
+
}, {
|
|
51836
|
+
html: `
|
|
51837
|
+
<a href="#" role="button" class="transition-all inline-block cursor-pointer no-underline border-2 border-solid mr-1 py-2 px-8 font-normal leading-relaxed border-transparent rounded ml-0 mt-1 size-14 tracking-125 hover:border-transparent uppercase" style="color: rgb(0, 0, 0); background-color: rgb(254, 222, 76);">Get Started</a>
|
|
51838
|
+
`
|
|
51839
|
+
}, {
|
|
51720
51840
|
text: 'Order Now',
|
|
51721
51841
|
className: 'transition-all inline-block cursor-pointer no-underline border-2 border-solid rounded-full border-current ml-1 mr-1 px-8 py-2 text-pink-600 hover:text-white bg-white hover:bg-pink-500 hover:border-transparent size-18 font-semibold tracking-75 leading-relaxed'
|
|
51722
51842
|
}, {
|
|
@@ -51768,7 +51888,11 @@ class ButtonEditor {
|
|
|
51768
51888
|
let html = '';
|
|
51769
51889
|
|
|
51770
51890
|
for (let i = 0; i < templates.length; i++) {
|
|
51771
|
-
|
|
51891
|
+
if (templates[i].html) {
|
|
51892
|
+
html += templates[i].html;
|
|
51893
|
+
} else {
|
|
51894
|
+
html += `<a class="${templates[i].className}" href="#" role="button" tabindex="0">${templates[i].text}</a>`;
|
|
51895
|
+
}
|
|
51772
51896
|
}
|
|
51773
51897
|
|
|
51774
51898
|
document.querySelector('#divButtonTemplateList').innerHTML = html;
|
|
@@ -51776,10 +51900,30 @@ class ButtonEditor {
|
|
|
51776
51900
|
Array.prototype.forEach.call(btns, btn => {
|
|
51777
51901
|
btn.addEventListener('click', e => {
|
|
51778
51902
|
this.builder.uo.saveForUndo();
|
|
51779
|
-
const activeButton = this.builder.activeButton || this.builder.activeLinkButton;
|
|
51780
|
-
this.
|
|
51781
|
-
|
|
51782
|
-
|
|
51903
|
+
const activeButton = this.builder.activeButton || this.builder.activeLinkButton; // this.applyStyles(activeButton, btn);
|
|
51904
|
+
// this.cleanupOldClasses(activeButton);
|
|
51905
|
+
|
|
51906
|
+
activeButton.removeAttribute('style');
|
|
51907
|
+
activeButton.removeAttribute('onmouseover');
|
|
51908
|
+
activeButton.removeAttribute('onmouseout');
|
|
51909
|
+
activeButton.removeAttribute('data-bg');
|
|
51910
|
+
activeButton.removeAttribute('data-hover-bg');
|
|
51911
|
+
activeButton.setAttribute('class', btn.getAttribute('class'));
|
|
51912
|
+
if (btn.hasAttribute('style')) activeButton.setAttribute('style', btn.getAttribute('style'));
|
|
51913
|
+
if (btn.hasAttribute('onmouseover')) activeButton.setAttribute('onmouseover', btn.getAttribute('onmouseover'));
|
|
51914
|
+
if (btn.hasAttribute('onmouseout')) activeButton.setAttribute('onmouseout', btn.getAttribute('onmouseout'));
|
|
51915
|
+
|
|
51916
|
+
if (btn.hasAttribute('data-bg')) {
|
|
51917
|
+
activeButton.setAttribute('data-bg', btn.getAttribute('data-bg'));
|
|
51918
|
+
activeButton.style.backgroundColor = btn.getAttribute('data-bg');
|
|
51919
|
+
}
|
|
51920
|
+
|
|
51921
|
+
if (btn.hasAttribute('data-hover-bg')) {
|
|
51922
|
+
activeButton.setAttribute('data-hover-bg', btn.getAttribute('data-hover-bg'));
|
|
51923
|
+
}
|
|
51924
|
+
|
|
51925
|
+
activeButton.classList.remove('active');
|
|
51926
|
+
this.realtime();
|
|
51783
51927
|
e.preventDefault();
|
|
51784
51928
|
return false;
|
|
51785
51929
|
});
|
|
@@ -51793,14 +51937,26 @@ class ButtonEditor {
|
|
|
51793
51937
|
let html_mybuttons = '';
|
|
51794
51938
|
|
|
51795
51939
|
for (let i = 0; i < mybuttons.length; i++) {
|
|
51796
|
-
|
|
51940
|
+
let sDataBg = '';
|
|
51941
|
+
if (mybuttons[i].bg !== '') sDataBg = ` data-bg="${mybuttons[i].bg}"`;
|
|
51942
|
+
let sDataHoverBg = '';
|
|
51943
|
+
if (mybuttons[i].hoverBg !== '') sDataHoverBg = ` data-hover-bg="${mybuttons[i].hoverBg}"`;
|
|
51944
|
+
|
|
51945
|
+
if (sDataHoverBg !== '' && sDataBg === '') {
|
|
51946
|
+
sDataBg = ' data-bg=""';
|
|
51947
|
+
}
|
|
51948
|
+
|
|
51949
|
+
html_mybuttons += `<a data-id="${mybuttons[i].id}"${sDataBg}${sDataHoverBg} class="${mybuttons[i].className}" href="#" style="${mybuttons[i].cssText}">Button<span class="is-button-remove"><svg class="is-icon-flex" style="fill:rgba(255, 255, 266, 1);width:20px;height:20px;"><use xlink:href="#ion-ios-close-empty"></use></svg></span></a>`;
|
|
51797
51950
|
}
|
|
51798
51951
|
|
|
51799
51952
|
document.querySelector('#divMyButtonList').innerHTML = html_mybuttons;
|
|
51800
51953
|
let btns = this.buttonModal.querySelectorAll('#divMyButtonList a');
|
|
51801
51954
|
Array.prototype.forEach.call(btns, btn => {
|
|
51802
|
-
|
|
51803
|
-
|
|
51955
|
+
if (btn.getAttribute('data-hover-bg')) {
|
|
51956
|
+
btn.setAttribute('onmouseover', 'if(this.getAttribute(\'data-hover-bg\'))this.style.backgroundColor=this.getAttribute(\'data-hover-bg\');');
|
|
51957
|
+
btn.setAttribute('onmouseout', 'if(this.getAttribute(\'data-bg\'))this.style.backgroundColor=this.getAttribute(\'data-bg\');else this.style.backgroundColor=\'\'');
|
|
51958
|
+
}
|
|
51959
|
+
|
|
51804
51960
|
btn.addEventListener('click', e => {
|
|
51805
51961
|
this.builder.uo.saveForUndo();
|
|
51806
51962
|
const activeButton = this.builder.activeButton || this.builder.activeLinkButton;
|
|
@@ -51808,10 +51964,31 @@ class ButtonEditor {
|
|
|
51808
51964
|
Array.prototype.forEach.call(links, link => {
|
|
51809
51965
|
dom.removeClass(link, 'active');
|
|
51810
51966
|
});
|
|
51811
|
-
dom.addClass(btn, 'active');
|
|
51812
|
-
this.
|
|
51813
|
-
|
|
51967
|
+
dom.addClass(btn, 'active'); // this.applyStyles(activeButton, btn);
|
|
51968
|
+
// this.cleanupOldClasses(activeButton);
|
|
51969
|
+
|
|
51970
|
+
activeButton.removeAttribute('style');
|
|
51971
|
+
activeButton.removeAttribute('onmouseover');
|
|
51972
|
+
activeButton.removeAttribute('onmouseout');
|
|
51973
|
+
activeButton.removeAttribute('data-bg');
|
|
51974
|
+
activeButton.removeAttribute('data-hover-bg');
|
|
51975
|
+
activeButton.setAttribute('class', btn.getAttribute('class'));
|
|
51976
|
+
if (btn.hasAttribute('style')) activeButton.setAttribute('style', btn.getAttribute('style'));
|
|
51977
|
+
if (btn.hasAttribute('onmouseover')) activeButton.setAttribute('onmouseover', btn.getAttribute('onmouseover'));
|
|
51978
|
+
if (btn.hasAttribute('onmouseout')) activeButton.setAttribute('onmouseout', btn.getAttribute('onmouseout'));
|
|
51979
|
+
|
|
51980
|
+
if (btn.hasAttribute('data-bg')) {
|
|
51981
|
+
activeButton.setAttribute('data-bg', btn.getAttribute('data-bg'));
|
|
51982
|
+
activeButton.style.backgroundColor = btn.getAttribute('data-bg');
|
|
51983
|
+
}
|
|
51984
|
+
|
|
51985
|
+
if (btn.hasAttribute('data-hover-bg')) {
|
|
51986
|
+
activeButton.setAttribute('data-hover-bg', btn.getAttribute('data-hover-bg'));
|
|
51987
|
+
}
|
|
51988
|
+
|
|
51989
|
+
activeButton.classList.remove('active');
|
|
51814
51990
|
this.builder.opts.onChange();
|
|
51991
|
+
this.realtime();
|
|
51815
51992
|
e.preventDefault();
|
|
51816
51993
|
return false;
|
|
51817
51994
|
});
|
|
@@ -51872,23 +52049,15 @@ class ButtonEditor {
|
|
|
51872
52049
|
}
|
|
51873
52050
|
|
|
51874
52051
|
applyDefault(link) {
|
|
51875
|
-
const dom = this.dom;
|
|
51876
|
-
dom.addClass(link, 'transition-all');
|
|
51877
|
-
if
|
|
51878
|
-
dom.addClass(link, 'cursor-pointer');
|
|
51879
|
-
|
|
51880
|
-
dom.addClass(link, '
|
|
51881
|
-
dom.addClass(link, 'leading-relaxed'); // dom.addClass(link, 'mt-2');
|
|
51882
|
-
// dom.addClass(link, 'mb-2');
|
|
51883
|
-
// link.removeAttribute('style');
|
|
51884
|
-
// link.removeAttribute('onmouseover');
|
|
51885
|
-
// link.removeAttribute('onmouseout');
|
|
51886
|
-
|
|
52052
|
+
// const dom = this.dom;
|
|
52053
|
+
// dom.addClass(link, 'transition-all');
|
|
52054
|
+
// if(!dom.hasClass(link,'flex')) dom.addClass(link, 'inline-block');
|
|
52055
|
+
// dom.addClass(link, 'cursor-pointer');
|
|
52056
|
+
// dom.addClass(link, 'border-solid');
|
|
52057
|
+
// dom.addClass(link, 'leading-relaxed');
|
|
51887
52058
|
link.removeAttribute('data-hover-bgcolor');
|
|
51888
52059
|
link.removeAttribute('data-hover-color');
|
|
51889
52060
|
link.removeAttribute('data-hover-bordercolor');
|
|
51890
|
-
link.setAttribute('onmouseover', 'if(this.getAttribute(\'data-hover-bg\'))this.style.backgroundColor=this.getAttribute(\'data-hover-bg\');');
|
|
51891
|
-
link.setAttribute('onmouseout', 'if(this.getAttribute(\'data-bg\'))this.style.backgroundColor=this.getAttribute(\'data-bg\');else this.style.backgroundColor=\'\'');
|
|
51892
52061
|
}
|
|
51893
52062
|
|
|
51894
52063
|
cleanupOldClasses(link) {
|