@innovastudio/contentbuilder 1.3.16 → 1.3.17

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/contentbuilder",
3
3
  "type": "module",
4
- "version": "1.3.16",
4
+ "version": "1.3.17",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "files": [
@@ -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 150px solid;
2360
+ border-top: transparent 70px solid;
2349
2361
  box-sizing: border-box;
2350
2362
  overflow: hidden;
2351
2363
  overflow-y: auto;
@@ -49302,6 +49302,7 @@ class Image$1 {
49302
49302
  <button title="3x4" data-crop-size="0.75" style="width: 45px;height: 60px;">3x4</button>
49303
49303
  <button title="6x4" data-crop-size="1.5" style="width: 60px;height: 40px;">6x4</button>
49304
49304
  <button title="4x6" data-crop-size="0.6666" style="width: 40px;height: 60px;">4x6</button>
49305
+ <button title="16x9" data-crop-size="1.77" style="width: 60px;height: 35px;">16x9</button>
49305
49306
  <button title="${util.out('Free')}" data-crop-size="" style="width: 60px;height: 45px;">${util.out('Free')}</button>
49306
49307
  </div>
49307
49308
  <div class="imageedit-preview" style="max-width:1000px;width:100%;max-height:550px;">
@@ -50617,7 +50618,7 @@ class ButtonEditor {
50617
50618
  ${util.out('Button')}
50618
50619
  <button class="is-modal-close" tabindex="-1" title="${util.out('Close')}">&#10005;</button>
50619
50620
  </div>
50620
- <div style="padding:0">
50621
+ <div style="padding:0;height:100%;">
50621
50622
  <div class="is-tabs" data-group="button" style="position:relative;z-index:1">
50622
50623
  <a title="${util.out('General')}" href="" data-content="divButtonGeneral" class="active">${util.out('General')}</a>
50623
50624
  <a title="${util.out('Hover')}" href="" data-content="divButtonHover">${util.out('Hover')}</a>
@@ -50924,8 +50925,8 @@ class ButtonEditor {
50924
50925
  let elm = e.target;
50925
50926
  this.builder.colorPicker.open(color => {
50926
50927
  const activeButton = this.builder.activeButton || this.builder.activeLinkButton;
50927
- activeButton.style.backgroundColor = color;
50928
- activeButton.setAttribute('data-bg', color);
50928
+ activeButton.style.backgroundColor = color; // activeButton.setAttribute('data-bg', color);
50929
+
50929
50930
  dom.removeClassesByPrefix(activeButton, 'bg-');
50930
50931
  elm.style.backgroundColor = color; // preview
50931
50932
  //Trigger Change event
@@ -50989,10 +50990,20 @@ class ButtonEditor {
50989
50990
  let elm = e.target;
50990
50991
  this.builder.colorPicker.open(color => {
50991
50992
  const activeButton = this.builder.activeButton || this.builder.activeLinkButton;
50992
- activeButton.setAttribute('data-hover-bg', color);
50993
+
50994
+ if (color === '') {
50995
+ activeButton.removeAttribute('data-bg');
50996
+ activeButton.removeAttribute('data-hover-bg');
50997
+ activeButton.removeAttribute('onmouseover');
50998
+ activeButton.removeAttribute('onmouseout');
50999
+ } else {
51000
+ activeButton.setAttribute('data-bg', activeButton.style.backgroundColor);
51001
+ activeButton.setAttribute('data-hover-bg', color);
51002
+ activeButton.setAttribute('onmouseover', 'if(this.getAttribute(\'data-hover-bg\'))this.style.backgroundColor=this.getAttribute(\'data-hover-bg\');');
51003
+ activeButton.setAttribute('onmouseout', 'if(this.getAttribute(\'data-bg\'))this.style.backgroundColor=this.getAttribute(\'data-bg\');else this.style.backgroundColor=\'\'');
51004
+ }
51005
+
50993
51006
  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
51007
  elm.style.backgroundColor = color; // preview
50997
51008
  //Trigger Change event
50998
51009
 
@@ -51449,15 +51460,20 @@ class ButtonEditor {
51449
51460
 
51450
51461
  dom.removeClass(activeButton, 'active');
51451
51462
  dom.removeClass(activeButton, 'elm-active');
51452
- const dataBg = activeButton.getAttribute('data-bg');
51453
- const dataHoverBg = activeButton.getAttribute('data-hover-bg');
51454
- const color = activeButton.style.color;
51463
+ let dataBg = activeButton.getAttribute('data-bg'); // if(!dataBg) {
51464
+ // if(activeButton.style.backgroundColor) dataBg=activeButton.style.backgroundColor;
51465
+ // }
51466
+
51467
+ const dataHoverBg = activeButton.getAttribute('data-hover-bg'); // const color = activeButton.style.color;
51468
+
51469
+ const cssText = activeButton.style.cssText;
51455
51470
  mybuttons.push({
51456
51471
  id: mybuttons.length,
51457
51472
  className: activeButton.className,
51458
51473
  bg: dataBg ? dataBg : '',
51459
51474
  hoverBg: dataHoverBg ? dataHoverBg : '',
51460
- color: color ? color : ''
51475
+ // color: color?color:'',
51476
+ cssText: cssText
51461
51477
  });
51462
51478
  localStorage.setItem('_savedbuttons', JSON.stringify(mybuttons));
51463
51479
  this.renderMyButtons();
@@ -51492,6 +51508,14 @@ class ButtonEditor {
51492
51508
  this.getVisibleBgColor(item.replace('hover:', ''), color => {
51493
51509
  btnHoverBgColor.style.backgroundColor = color;
51494
51510
  activeButton.setAttribute('data-hover-bg', color); //new inline
51511
+
51512
+ if (!activeButton.hasAttribute('data-bg')) {
51513
+ // fix needed data-bg
51514
+ activeButton.setAttribute('data-bg', btnBgColor.style.backgroundColor); // needed by hover
51515
+ }
51516
+
51517
+ activeButton.setAttribute('onmouseover', 'if(this.getAttribute(\'data-hover-bg\'))this.style.backgroundColor=this.getAttribute(\'data-hover-bg\');');
51518
+ activeButton.setAttribute('onmouseout', 'if(this.getAttribute(\'data-bg\'))this.style.backgroundColor=this.getAttribute(\'data-bg\');else this.style.backgroundColor=\'\'');
51495
51519
  });
51496
51520
  }
51497
51521
 
@@ -51518,7 +51542,13 @@ class ButtonEditor {
51518
51542
  } // NEW: inline color
51519
51543
 
51520
51544
 
51521
- if (activeButton.style.backgroundColor) btnBgColor.style.backgroundColor = activeButton.getAttribute('data-bg'); //activeButton.style.backgroundColor;
51545
+ if (activeButton.hasAttribute('data-bg')) {
51546
+ btnBgColor.style.backgroundColor = activeButton.getAttribute('data-bg');
51547
+ } else {
51548
+ if (activeButton.style.backgroundColor) {
51549
+ btnBgColor.style.backgroundColor = activeButton.style.backgroundColor;
51550
+ }
51551
+ }
51522
51552
 
51523
51553
  if (activeButton.getAttribute('data-hover-bg')) btnHoverBgColor.style.backgroundColor = activeButton.getAttribute('data-hover-bg');
51524
51554
  if (activeButton.style.color) btnTextColor.style.backgroundColor = activeButton.style.color;
@@ -51716,7 +51746,95 @@ class ButtonEditor {
51716
51746
  }
51717
51747
 
51718
51748
  renderTemplates() {
51719
- const templates = [{
51749
+ const templates = [
51750
+ /* rounded */
51751
+ {
51752
+ html: `
51753
+ <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>
51754
+ `
51755
+ }, {
51756
+ html: `
51757
+ <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>
51758
+ `
51759
+ }, {
51760
+ html: `
51761
+ <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>
51762
+ `
51763
+ }, {
51764
+ html: `
51765
+ <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>
51766
+ `
51767
+ }, {
51768
+ html: `
51769
+ <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>
51770
+ `
51771
+ }, {
51772
+ html: `
51773
+ <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>
51774
+ `
51775
+ },
51776
+ /* colors */
51777
+ {
51778
+ html: `
51779
+ <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>
51780
+ `
51781
+ }, {
51782
+ html: `
51783
+ <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>
51784
+ `
51785
+ }, {
51786
+ html: `
51787
+ <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>
51788
+ `
51789
+ }, {
51790
+ html: `
51791
+ <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>
51792
+ `
51793
+ },
51794
+ /* square */
51795
+ {
51796
+ html: `
51797
+ <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>
51798
+ `
51799
+ }, {
51800
+ html: `
51801
+ <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>
51802
+ `
51803
+ }, {
51804
+ html: `
51805
+ <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>
51806
+ `
51807
+ }, {
51808
+ html: `
51809
+ <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>
51810
+ `
51811
+ }, {
51812
+ html: `
51813
+ <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>
51814
+ `
51815
+ }, {
51816
+ html: `
51817
+ <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>
51818
+ `
51819
+ },
51820
+ /* colors */
51821
+ {
51822
+ html: `
51823
+ <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>
51824
+ `
51825
+ }, {
51826
+ html: `
51827
+ <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>
51828
+ `
51829
+ }, {
51830
+ html: `
51831
+ <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>
51832
+ `
51833
+ }, {
51834
+ html: `
51835
+ <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>
51836
+ `
51837
+ }, {
51720
51838
  text: 'Order Now',
51721
51839
  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
51840
  }, {
@@ -51768,7 +51886,11 @@ class ButtonEditor {
51768
51886
  let html = '';
51769
51887
 
51770
51888
  for (let i = 0; i < templates.length; i++) {
51771
- html += `<a class="${templates[i].className}" href="#" role="button" tabindex="0">${templates[i].text}</a>`;
51889
+ if (templates[i].html) {
51890
+ html += templates[i].html;
51891
+ } else {
51892
+ html += `<a class="${templates[i].className}" href="#" role="button" tabindex="0">${templates[i].text}</a>`;
51893
+ }
51772
51894
  }
51773
51895
 
51774
51896
  document.querySelector('#divButtonTemplateList').innerHTML = html;
@@ -51776,10 +51898,30 @@ class ButtonEditor {
51776
51898
  Array.prototype.forEach.call(btns, btn => {
51777
51899
  btn.addEventListener('click', e => {
51778
51900
  this.builder.uo.saveForUndo();
51779
- const activeButton = this.builder.activeButton || this.builder.activeLinkButton;
51780
- this.applyStyles(activeButton, btn);
51781
- this.cleanupOldClasses(activeButton);
51782
- this.builder.opts.onChange();
51901
+ const activeButton = this.builder.activeButton || this.builder.activeLinkButton; // this.applyStyles(activeButton, btn);
51902
+ // this.cleanupOldClasses(activeButton);
51903
+
51904
+ activeButton.removeAttribute('style');
51905
+ activeButton.removeAttribute('onmouseover');
51906
+ activeButton.removeAttribute('onmouseout');
51907
+ activeButton.removeAttribute('data-bg');
51908
+ activeButton.removeAttribute('data-hover-bg');
51909
+ activeButton.setAttribute('class', btn.getAttribute('class'));
51910
+ if (btn.hasAttribute('style')) activeButton.setAttribute('style', btn.getAttribute('style'));
51911
+ if (btn.hasAttribute('onmouseover')) activeButton.setAttribute('onmouseover', btn.getAttribute('onmouseover'));
51912
+ if (btn.hasAttribute('onmouseout')) activeButton.setAttribute('onmouseout', btn.getAttribute('onmouseout'));
51913
+
51914
+ if (btn.hasAttribute('data-bg')) {
51915
+ activeButton.setAttribute('data-bg', btn.getAttribute('data-bg'));
51916
+ activeButton.style.backgroundColor = btn.getAttribute('data-bg');
51917
+ }
51918
+
51919
+ if (btn.hasAttribute('data-hover-bg')) {
51920
+ activeButton.setAttribute('data-hover-bg', btn.getAttribute('data-hover-bg'));
51921
+ }
51922
+
51923
+ activeButton.classList.remove('active');
51924
+ this.realtime();
51783
51925
  e.preventDefault();
51784
51926
  return false;
51785
51927
  });
@@ -51793,14 +51935,26 @@ class ButtonEditor {
51793
51935
  let html_mybuttons = '';
51794
51936
 
51795
51937
  for (let i = 0; i < mybuttons.length; i++) {
51796
- html_mybuttons += `<a data-id="${mybuttons[i].id}" data-bg="${mybuttons[i].bg}" data-hover-bg="${mybuttons[i].hoverBg}" class="${mybuttons[i].className}" href="#" style="color:${mybuttons[i].color};background-color:${mybuttons[i].bg}">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>`;
51938
+ let sDataBg = '';
51939
+ if (mybuttons[i].bg !== '') sDataBg = ` data-bg="${mybuttons[i].bg}"`;
51940
+ let sDataHoverBg = '';
51941
+ if (mybuttons[i].hoverBg !== '') sDataHoverBg = ` data-hover-bg="${mybuttons[i].hoverBg}"`;
51942
+
51943
+ if (sDataHoverBg !== '' && sDataBg === '') {
51944
+ sDataBg = ' data-bg=""';
51945
+ }
51946
+
51947
+ 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
51948
  }
51798
51949
 
51799
51950
  document.querySelector('#divMyButtonList').innerHTML = html_mybuttons;
51800
51951
  let btns = this.buttonModal.querySelectorAll('#divMyButtonList a');
51801
51952
  Array.prototype.forEach.call(btns, btn => {
51802
- btn.setAttribute('onmouseover', 'if(this.getAttribute(\'data-hover-bg\'))this.style.backgroundColor=this.getAttribute(\'data-hover-bg\');');
51803
- btn.setAttribute('onmouseout', 'if(this.getAttribute(\'data-bg\'))this.style.backgroundColor=this.getAttribute(\'data-bg\');else this.style.backgroundColor=\'\'');
51953
+ if (btn.getAttribute('data-hover-bg')) {
51954
+ btn.setAttribute('onmouseover', 'if(this.getAttribute(\'data-hover-bg\'))this.style.backgroundColor=this.getAttribute(\'data-hover-bg\');');
51955
+ btn.setAttribute('onmouseout', 'if(this.getAttribute(\'data-bg\'))this.style.backgroundColor=this.getAttribute(\'data-bg\');else this.style.backgroundColor=\'\'');
51956
+ }
51957
+
51804
51958
  btn.addEventListener('click', e => {
51805
51959
  this.builder.uo.saveForUndo();
51806
51960
  const activeButton = this.builder.activeButton || this.builder.activeLinkButton;
@@ -51808,10 +51962,31 @@ class ButtonEditor {
51808
51962
  Array.prototype.forEach.call(links, link => {
51809
51963
  dom.removeClass(link, 'active');
51810
51964
  });
51811
- dom.addClass(btn, 'active');
51812
- this.applyStyles(activeButton, btn);
51813
- this.cleanupOldClasses(activeButton);
51965
+ dom.addClass(btn, 'active'); // this.applyStyles(activeButton, btn);
51966
+ // this.cleanupOldClasses(activeButton);
51967
+
51968
+ activeButton.removeAttribute('style');
51969
+ activeButton.removeAttribute('onmouseover');
51970
+ activeButton.removeAttribute('onmouseout');
51971
+ activeButton.removeAttribute('data-bg');
51972
+ activeButton.removeAttribute('data-hover-bg');
51973
+ activeButton.setAttribute('class', btn.getAttribute('class'));
51974
+ if (btn.hasAttribute('style')) activeButton.setAttribute('style', btn.getAttribute('style'));
51975
+ if (btn.hasAttribute('onmouseover')) activeButton.setAttribute('onmouseover', btn.getAttribute('onmouseover'));
51976
+ if (btn.hasAttribute('onmouseout')) activeButton.setAttribute('onmouseout', btn.getAttribute('onmouseout'));
51977
+
51978
+ if (btn.hasAttribute('data-bg')) {
51979
+ activeButton.setAttribute('data-bg', btn.getAttribute('data-bg'));
51980
+ activeButton.style.backgroundColor = btn.getAttribute('data-bg');
51981
+ }
51982
+
51983
+ if (btn.hasAttribute('data-hover-bg')) {
51984
+ activeButton.setAttribute('data-hover-bg', btn.getAttribute('data-hover-bg'));
51985
+ }
51986
+
51987
+ activeButton.classList.remove('active');
51814
51988
  this.builder.opts.onChange();
51989
+ this.realtime();
51815
51990
  e.preventDefault();
51816
51991
  return false;
51817
51992
  });
@@ -51872,23 +52047,15 @@ class ButtonEditor {
51872
52047
  }
51873
52048
 
51874
52049
  applyDefault(link) {
51875
- const dom = this.dom;
51876
- dom.addClass(link, 'transition-all');
51877
- if (!dom.hasClass(link, 'flex')) dom.addClass(link, 'inline-block');
51878
- dom.addClass(link, 'cursor-pointer'); // dom.addClass(link, 'border-2');
51879
-
51880
- dom.addClass(link, 'border-solid');
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
-
52050
+ // const dom = this.dom;
52051
+ // dom.addClass(link, 'transition-all');
52052
+ // if(!dom.hasClass(link,'flex')) dom.addClass(link, 'inline-block');
52053
+ // dom.addClass(link, 'cursor-pointer');
52054
+ // dom.addClass(link, 'border-solid');
52055
+ // dom.addClass(link, 'leading-relaxed');
51887
52056
  link.removeAttribute('data-hover-bgcolor');
51888
52057
  link.removeAttribute('data-hover-color');
51889
52058
  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
52059
  }
51893
52060
 
51894
52061
  cleanupOldClasses(link) {