@innovastudio/contentbuilder 1.3.27 → 1.3.29

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.
@@ -4081,7 +4081,7 @@ class Util {
4081
4081
  let c = cell.nextElementSibling;
4082
4082
 
4083
4083
  if (c) {
4084
- if (!dom.hasClass(c, 'is-row-tool') && !dom.hasClass(c, 'is-rowadd-tool') && !dom.hasClass(c, 'is-row-overlay')) {
4084
+ if (!dom.hasClass(c, 'is-row-tool') && !dom.hasClass(c, 'is-col-tool') && !dom.hasClass(c, 'is-rowadd-tool') && !dom.hasClass(c, 'is-row-overlay')) {
4085
4085
  return c;
4086
4086
  } else {
4087
4087
  return null;
@@ -4530,18 +4530,18 @@ class Util {
4530
4530
 
4531
4531
  Array.from(row.children).map(item => {
4532
4532
  if (item.classList.contains('is-row-tool')) return;
4533
+ if (item.classList.contains('is-col-tool')) return;
4533
4534
  if (item.classList.contains('is-rowadd-tool')) return;
4534
4535
  item.style.width = '';
4535
4536
  item.style.flex = '';
4536
4537
  });
4537
- let num = 2; //is-row-tool & is-rowadd-tool
4538
+ let num = 3; //is-row-tool, is-col-tool & is-rowadd-tool
4538
4539
 
4539
4540
  if (row.querySelector('.is-row-overlay')) {
4540
- num = 3; //is-row-tool, is-rowadd-tool & is-row-overlay
4541
+ num = 4; //is-row-tool, is-col-tool, is-rowadd-tool & is-row-overlay
4541
4542
  }
4542
4543
 
4543
- const cellCount = row.childElementCount - num; //minus is-row-tool & is-rowadd-tool
4544
-
4544
+ const cellCount = row.childElementCount - num;
4545
4545
  const rowClass = this.builder.opts.row;
4546
4546
  const colClass = this.builder.opts.cols;
4547
4547
  const colEqual = this.builder.opts.colequal;
@@ -4549,7 +4549,7 @@ class Util {
4549
4549
  if (colEqual.length > 0) {
4550
4550
  const cols = dom.elementChildren(row);
4551
4551
  cols.forEach(col => {
4552
- if (dom.hasClass(col, 'is-row-tool') || dom.hasClass(col, 'is-rowadd-tool') || dom.hasClass(col, 'is-row-overlay')) return;
4552
+ if (dom.hasClass(col, 'is-row-tool') || dom.hasClass(col, 'is-col-tool') || dom.hasClass(col, 'is-rowadd-tool') || dom.hasClass(col, 'is-row-overlay')) return;
4553
4553
 
4554
4554
  for (let i = 0; i <= colClass.length - 1; i++) {
4555
4555
  dom.removeClass(col, colClass[i]);
@@ -4570,6 +4570,7 @@ class Util {
4570
4570
  Array.from(row.children).map(item => {
4571
4571
  if (item.classList.contains('is-row-tool')) return;
4572
4572
  if (item.classList.contains('is-rowadd-tool')) return;
4573
+ if (item.classList.contains('is-col-tool')) return;
4573
4574
 
4574
4575
  if (item.getAttribute('data-module')) {
4575
4576
  this.refreshModuleLayout(item);
@@ -4583,7 +4584,7 @@ class Util {
4583
4584
  let n = 0;
4584
4585
  const cols = dom.elementChildren(row);
4585
4586
  cols.forEach(col => {
4586
- if (dom.hasClass(col, 'is-row-tool') || dom.hasClass(col, 'is-rowadd-tool') || dom.hasClass(col, 'is-row-overlay')) return;
4587
+ if (dom.hasClass(col, 'is-row-tool') || dom.hasClass(col, 'is-col-tool') || dom.hasClass(col, 'is-rowadd-tool') || dom.hasClass(col, 'is-row-overlay')) return;
4587
4588
  n++;
4588
4589
 
4589
4590
  for (var i = 0; i <= colClass.length - 1; i++) {
@@ -4635,6 +4636,7 @@ class Util {
4635
4636
  Array.from(row.children).map(item => {
4636
4637
  if (item.classList.contains('is-row-tool')) return;
4637
4638
  if (item.classList.contains('is-rowadd-tool')) return;
4639
+ if (item.classList.contains('is-col-tool')) return;
4638
4640
 
4639
4641
  if (item.getAttribute('data-module')) {
4640
4642
  this.refreshModuleLayout(item);
@@ -4671,14 +4673,14 @@ class Util {
4671
4673
  } //Limit up to 4 cells in a row
4672
4674
 
4673
4675
 
4674
- let num = 2; //is-row-tool & is-rowadd-tool
4676
+ let num = 3; //is-row-tool, is-col-tool & is-rowadd-tool
4675
4677
 
4676
4678
  if (row.querySelector('.is-row-overlay')) {
4677
- num = 3; //is-row-tool, is-rowadd-tool & is-row-overlay
4679
+ num = 4; //is-row-tool, is-col-tool, is-rowadd-tool & is-row-overlay
4678
4680
  }
4679
4681
 
4680
4682
  if (row.childElementCount >= maxCols + num) {
4681
- //+3 => includes is-row-tool, is-rowadd-tool & is-row-overlay
4683
+ //+3 => includes is-row-tool, is-col-tool, is-rowadd-tool & is-row-overlay
4682
4684
  alert(this.out('You have reached the maximum number of columns'));
4683
4685
  return false;
4684
4686
  }
@@ -4842,7 +4844,6 @@ class Util {
4842
4844
  let bAddLast = false;
4843
4845
  let cell;
4844
4846
  let cellElement;
4845
- let columnTool;
4846
4847
  const builderStuff = this.builder.builderStuff;
4847
4848
  let quickadd = builderStuff.querySelector('.quickadd');
4848
4849
  const mode = quickadd.getAttribute('data-mode');
@@ -4908,9 +4909,9 @@ class Util {
4908
4909
  cellElement.click(); //change active block to the newly created
4909
4910
  // Change to row selection
4910
4911
 
4911
- rowElement.className = rowElement.className.replace('row-outline', '');
4912
- columnTool = this.builder.doc.querySelector('.is-column-tool');
4913
- columnTool.className = columnTool.className.replace('active', '');
4912
+ rowElement.className = rowElement.className.replace('row-outline', ''); //Hide Column tool (new!)
4913
+
4914
+ this.builder.util.hideColumnTool();
4914
4915
  } else if (bSnippet) {
4915
4916
  if (noedit) {
4916
4917
  this.addContent(html, mode, 'data-noedit');
@@ -4956,14 +4957,14 @@ class Util {
4956
4957
 
4957
4958
 
4958
4959
  if (row.querySelector('.is-row-overlay')) {
4959
- if (row.childElementCount >= maxCols + 3) {
4960
- //+3 => includes is-row-tool, is-rowadd-tool & is-row-overlay
4960
+ if (row.childElementCount >= maxCols + 4) {
4961
+ //+4 => includes is-row-tool, is-col-tool, is-rowadd-tool & is-row-overlay
4961
4962
  alert(this.out('You have reached the maximum number of columns'));
4962
4963
  return false;
4963
4964
  }
4964
4965
  } else {
4965
- if (row.childElementCount >= maxCols + 2) {
4966
- //+2 => includes is-row-tool & is-rowadd-tool
4966
+ if (row.childElementCount >= maxCols + 3) {
4967
+ //+3 => includes is-row-tool, is-col-tool & is-rowadd-tool
4967
4968
  alert(this.out('You have reached the maximum number of columns'));
4968
4969
  return false;
4969
4970
  }
@@ -5051,10 +5052,9 @@ class Util {
5051
5052
  if (cellElement) cellElement.click(); //change active block to the newly created
5052
5053
  // Change to row selection
5053
5054
 
5054
- rowElement.className = rowElement.className.replace('row-outline', ''); // columnTool = parent.document.querySelector('.is-column-tool');
5055
+ rowElement.className = rowElement.className.replace('row-outline', ''); //Hide Column tool (new!)
5055
5056
 
5056
- columnTool = this.builder.doc.querySelector('.is-column-tool');
5057
- columnTool.className = columnTool.className.replace('active', '');
5057
+ this.builder.util.hideColumnTool();
5058
5058
  }
5059
5059
 
5060
5060
  if (this.builder.useCssClasses) {
@@ -5169,7 +5169,9 @@ class Util {
5169
5169
  const builderStuff = this.builder.builderStuff;
5170
5170
  let tools = builderStuff.querySelectorAll('.is-tool');
5171
5171
  Array.prototype.forEach.call(tools, tool => {
5172
- if (tool.classList.contains('is-row-tool') || tool.classList.contains('is-column-tool') || tool.classList.contains('is-element-tool')) return;
5172
+ // if(tool.classList.contains('is-row-tool')||
5173
+ // tool.classList.contains('is-column-tool')||
5174
+ // tool.classList.contains('is-element-tool')) return;
5173
5175
  tool.style.display = '';
5174
5176
  dom.removeClass(tool, 'active');
5175
5177
  });
@@ -5741,27 +5743,59 @@ class Util {
5741
5743
  } // Quick reposition column tool
5742
5744
 
5743
5745
 
5744
- repositionColumnTool(transition) {
5745
- let columnTool = this.builder.colTool.columnTool;
5746
- if (!columnTool) return;
5746
+ repositionColumnTool() {
5747
5747
  let col = this.builder.activeCol;
5748
5748
  if (!col) return;
5749
+ let row = col.parentNode;
5749
5750
 
5750
- if (transition) {
5751
- columnTool.style.transition = 'all 100ms ease';
5751
+ if (!col.parentNode) {
5752
+ // when column has just been deleted
5753
+ row = this.rowSelected();
5754
+ }
5755
+
5756
+ this.colTool = row.querySelector('.is-col-tool');
5757
+
5758
+ if (!col.parentNode) {
5759
+ // when column has just been deleted
5760
+ this.colTool.style.display = 'none';
5761
+ }
5762
+
5763
+ this.colTool.style.left = col.offsetLeft + 'px'; // if columnMore is opened
5764
+
5765
+ const columnMore = this.builder.builderStuff.querySelector('.columnmore.active');
5766
+
5767
+ if (columnMore) {
5768
+ const btnCellMore = this.colTool.querySelector('.cell-more');
5769
+ columnMore.classList.add('transition1');
5752
5770
  setTimeout(() => {
5753
- columnTool.style.top = col.getBoundingClientRect().top - 29 + this.builder.win.pageYOffset + 'px';
5754
- columnTool.style.left = col.getBoundingClientRect().left - 1 + 'px';
5771
+ let top, left;
5772
+
5773
+ if (!this.builder.iframe) {
5774
+ top = btnCellMore.getBoundingClientRect().top + window.pageYOffset;
5775
+ left = btnCellMore.getBoundingClientRect().left + window.pageXOffset;
5776
+ } else {
5777
+ let adjY = this.builder.iframe.getBoundingClientRect().top + window.pageYOffset;
5778
+ let adjX = this.builder.iframe.getBoundingClientRect().left + window.pageXOffset;
5779
+ top = btnCellMore.getBoundingClientRect().top + adjY;
5780
+ left = btnCellMore.getBoundingClientRect().left + adjX;
5781
+ }
5782
+
5783
+ columnMore.style.top = top + 35 + 'px';
5784
+ columnMore.style.left = left - 7 + 'px';
5755
5785
  setTimeout(() => {
5756
- columnTool.style.transition = '';
5757
- }, 100);
5758
- }, 10);
5759
- } else {
5760
- columnTool.style.top = col.getBoundingClientRect().top - 29 + this.builder.win.pageYOffset + 'px';
5761
- columnTool.style.left = col.getBoundingClientRect().left - 1 + 'px';
5786
+ columnMore.classList.remove('transition1');
5787
+ }, 300);
5788
+ }, 30);
5762
5789
  }
5763
5790
  }
5764
5791
 
5792
+ hideColumnTool() {
5793
+ let tools = this.builder.doc.querySelectorAll('.is-col-tool');
5794
+ tools.forEach(tool => {
5795
+ tool.style.display = 'none';
5796
+ });
5797
+ }
5798
+
5765
5799
  isTouchSupport() {
5766
5800
  /*
5767
5801
  if(('ontouchstart' in window) || (navigator.MaxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)) {
@@ -6378,7 +6412,6 @@ class Util {
6378
6412
  <li role="option" tabindex="0" data-provider="google" data-font-family="Nunito, sans-serif" data-font-style="200,200i,600,600i,700,700i,800,800i,900,900i"><div></div><img src="${font_nunito}"></div>
6379
6413
  <li role="option" tabindex="0" data-provider="google" data-font-family="Old Standard TT, serif" data-font-style="400,400i,700"><div></div><img src="${font_old_standard_tt}"></div>
6380
6414
  <li role="option" tabindex="0" data-provider="google" data-font-family="Open Sans, sans-serif" data-font-style="300,400,600,800"><div></div><img src="${font_open_sans}"></div>
6381
- <li role="option" tabindex="0" data-provider="google" data-font-family="Open Sans Condensed, sans-serif" data-font-style="300,300i,700"><div></div><img src="${font_open_sans_condensed}"></div>
6382
6415
  <li role="option" tabindex="0" data-provider="google" data-font-family="Oranienbaum, serif"><div></div><img src="${font_oranienbaum}"></div>
6383
6416
  <li role="option" tabindex="0" data-provider="google" data-font-family="Oswald, sans-serif" data-font-style="300,400,700"><div></div><img src="${font_oswald}"></div>
6384
6417
  <li role="option" tabindex="0" data-provider="google" data-font-family="Oxygen, sans-serif" data-font-style="300,700"><div></div><img src="${font_oxygen}"></div>
@@ -6600,7 +6633,6 @@ class Util {
6600
6633
  <li role="option" tabindex="0" data-provider="google" data-font-family="Nunito, sans-serif" data-font-style="200,200i,600,600i,700,700i,800,800i,900,900i"><div></div><img src="${path}nunito.png"></li>
6601
6634
  <li role="option" tabindex="0" data-provider="google" data-font-family="Old Standard TT, serif" data-font-style="400,400i,700"><div></div><img src="${path}old_standard_tt.png"></li>
6602
6635
  <li role="option" tabindex="0" data-provider="google" data-font-family="Open Sans, sans-serif" data-font-style="300,400,600,800"><div></div><img src="${path}open_sans.png"></li>
6603
- <li role="option" tabindex="0" data-provider="google" data-font-family="Open Sans Condensed, sans-serif" data-font-style="300,300i,700"><div></div><img src="${path}open_sans_condensed.png"></li>
6604
6636
  <li role="option" tabindex="0" data-provider="google" data-font-family="Oranienbaum, serif"><div></div><img src="${path}oranienbaum.png"></li>
6605
6637
  <li role="option" tabindex="0" data-provider="google" data-font-family="Oswald, sans-serif" data-font-style="300,400,700"><div></div><img src="${path}oswald.png"></li>
6606
6638
  <li role="option" tabindex="0" data-provider="google" data-font-family="Oxygen, sans-serif" data-font-style="300,700"><div></div><img src="${path}oxygen.png"></li>
@@ -14837,10 +14869,7 @@ class HtmlUtil {
14837
14869
 
14838
14870
  this.builder.cleanHtmlFormatting = false; //Change to row selection
14839
14871
 
14840
- dom$h.removeClass(row, 'row-outline'); //Hide Column tool
14841
-
14842
- let columnTool = builderStuff.querySelector('.is-column-tool');
14843
- dom$h.removeClass(columnTool, 'active');
14872
+ dom$h.removeClass(row, 'row-outline');
14844
14873
  }
14845
14874
 
14846
14875
  if (mode === 'full') {
@@ -15189,6 +15218,8 @@ class HtmlUtil {
15189
15218
  dom$h.removeAttributes(elms, 'gray');
15190
15219
  elms = tmp.querySelectorAll('[rowoutline]');
15191
15220
  dom$h.removeAttributes(elms, 'rowoutline');
15221
+ elms = tmp.querySelectorAll('[hidecolumntool]');
15222
+ dom$h.removeAttributes(elms, 'hidecolumntool');
15192
15223
  elms = tmp.querySelectorAll('[grayoutline]');
15193
15224
  dom$h.removeAttributes(elms, 'grayoutline');
15194
15225
  elms = tmp.querySelectorAll('[hideoutline]');
@@ -15204,6 +15235,7 @@ class HtmlUtil {
15204
15235
  elms = tmp.querySelectorAll('[gridoutline]');
15205
15236
  dom$h.removeAttributes(elms, 'gridoutline');
15206
15237
  dom$h.removeElements(tmp.querySelectorAll('.is-row-tool'));
15238
+ dom$h.removeElements(tmp.querySelectorAll('.is-col-tool'));
15207
15239
  dom$h.removeElements(tmp.querySelectorAll('.is-rowadd-tool'));
15208
15240
  dom$h.removeElements(tmp.querySelectorAll('.ovl'));
15209
15241
  dom$h.removeElements(tmp.querySelectorAll('.row-add-initial')); //Extra cleaning
@@ -15435,6 +15467,7 @@ class UndoRedo {
15435
15467
  dom.removeAttributes(elms, 'data-click');
15436
15468
  dom.removeElements(tmp.querySelectorAll('.is-row-tool'));
15437
15469
  dom.removeElements(tmp.querySelectorAll('.is-rowadd-tool'));
15470
+ dom.removeElements(tmp.querySelectorAll('.is-col-tool'));
15438
15471
  dom.removeElements(tmp.querySelectorAll('.ovl'));
15439
15472
  dom.removeElements(tmp.querySelectorAll('.row-add-initial')); //ContentBox
15440
15473
 
@@ -17409,12 +17442,10 @@ class Grid {
17409
17442
  this.builderStuff = builderStuff;
17410
17443
  const dom = this.builder.dom;
17411
17444
  this.dom = dom;
17412
- this.columnTool = new ColumnTool$1(builder);
17413
17445
  this.rowTool = new RowTool$1(builder);
17414
17446
  }
17415
17447
 
17416
17448
  moveColumnPrevious() {
17417
- let columnTool = this.columnTool;
17418
17449
  let util = this.util;
17419
17450
  const cell = util.cellSelected();
17420
17451
  if (!cell) return;
@@ -17422,13 +17453,11 @@ class Grid {
17422
17453
  if (cell.previousElementSibling) {
17423
17454
  this.builder.uo.saveForUndo();
17424
17455
  cell.parentElement.insertBefore(cell, cell.previousElementSibling);
17425
- columnTool.position(cell);
17426
17456
  this.builder.opts.onChange();
17427
17457
  }
17428
17458
  }
17429
17459
 
17430
17460
  moveColumnNext() {
17431
- let columnTool = this.columnTool;
17432
17461
  let util = this.util;
17433
17462
  const cell = util.cellSelected();
17434
17463
  if (!cell) return;
@@ -17437,26 +17466,24 @@ class Grid {
17437
17466
  if (cellnext) {
17438
17467
  this.builder.uo.saveForUndo();
17439
17468
  cell.parentElement.insertBefore(cellnext, cell);
17440
- columnTool.position(cell);
17441
17469
  this.builder.opts.onChange();
17442
17470
  }
17443
17471
  }
17444
17472
 
17445
17473
  moveColumnUp() {
17446
17474
  let builder = this.builder;
17447
- let columnTool = this.columnTool;
17448
17475
  let util = this.util;
17449
17476
  const cell = util.cellSelected();
17450
17477
  if (!cell) return;
17451
17478
  let row = cell.parentNode;
17452
- let num = 2; //is-row-tool & is-rowadd-tool
17479
+ let num = 3; //is-row-tool, is-col-tool & is-rowadd-tool
17453
17480
 
17454
17481
  if (row.querySelector('.is-row-overlay')) {
17455
- num = 3; //is-row-tool, is-rowadd-tool & is-row-overlay
17482
+ num = 4; //is-row-tool, is-col-tool, is-rowadd-tool & is-row-overlay
17456
17483
  }
17457
17484
 
17458
17485
  if (row.childElementCount - num === 1) {
17459
- //-num => minus is-row-tool, is-rowadd-tool & is-row-overlay
17486
+ //-num => minus is-row-tool, is-col-tool, is-rowadd-tool & is-row-overlay
17460
17487
  if (row.previousElementSibling) {
17461
17488
  let maxCols = 4;
17462
17489
 
@@ -17469,7 +17496,6 @@ class Grid {
17469
17496
  this.builder.uo.saveForUndo(); //Move row up
17470
17497
 
17471
17498
  row.parentNode.insertBefore(row, row.previousElementSibling);
17472
- columnTool.position(cell);
17473
17499
  this.builder.opts.onChange();
17474
17500
  return;
17475
17501
  } else {
@@ -17479,7 +17505,10 @@ class Grid {
17479
17505
  row.previousElementSibling.removeChild(tool); //remove next row tool
17480
17506
 
17481
17507
  tool = row.previousElementSibling.querySelector('.is-rowadd-tool');
17482
- row.previousElementSibling.removeChild(tool); //remove next row tool
17508
+ row.previousElementSibling.removeChild(tool); //remove
17509
+
17510
+ tool = row.previousElementSibling.querySelector('.is-col-tool');
17511
+ row.previousElementSibling.removeChild(tool); //remove
17483
17512
 
17484
17513
  row.previousElementSibling.appendChild(cell); //add
17485
17514
 
@@ -17489,7 +17518,6 @@ class Grid {
17489
17518
  let builderActive = this.builder.doc.querySelector('.builder-active');
17490
17519
  builder.applyBehaviorOn(builderActive);
17491
17520
  setTimeout(() => {
17492
- columnTool.position(cell);
17493
17521
  cell.click(); //refresh active cell/row
17494
17522
  }, 30);
17495
17523
  this.builder.opts.onChange();
@@ -17508,7 +17536,6 @@ class Grid {
17508
17536
  let builderActive = this.builder.doc.querySelector('.builder-active');
17509
17537
  builder.applyBehaviorOn(builderActive);
17510
17538
  setTimeout(() => {
17511
- columnTool.position(cell);
17512
17539
  cell.click(); //refresh active cell/row
17513
17540
  }, 30);
17514
17541
  this.builder.opts.onChange();
@@ -17523,16 +17550,15 @@ class Grid {
17523
17550
 
17524
17551
  moveColumnDown() {
17525
17552
  let builder = this.builder;
17526
- let columnTool = this.columnTool;
17527
17553
  let util = this.util;
17528
17554
  let dom = this.dom;
17529
17555
  const cell = util.cellSelected();
17530
17556
  if (!cell) return;
17531
17557
  let row = cell.parentNode;
17532
- let num = 2; //is-row-tool & is-rowadd-tool
17558
+ let num = 3; //is-row-tool, is-col-tool & is-rowadd-tool
17533
17559
 
17534
17560
  if (row.querySelector('.is-row-overlay')) {
17535
- num = 3; //is-row-tool, is-rowadd-tool & is-row-overlay
17561
+ num = 4; //is-row-tool, is-col-tool, is-rowadd-tool & is-row-overlay
17536
17562
  }
17537
17563
 
17538
17564
  if (row.childElementCount - num === 1) {
@@ -17549,7 +17575,6 @@ class Grid {
17549
17575
  this.builder.uo.saveForUndo(); //Move row down
17550
17576
 
17551
17577
  row.parentNode.insertBefore(row.nextElementSibling, row);
17552
- columnTool.position(cell);
17553
17578
  this.builder.opts.onChange();
17554
17579
  return;
17555
17580
  } else {
@@ -17559,7 +17584,10 @@ class Grid {
17559
17584
  row.nextElementSibling.removeChild(tool); //remove next row tool
17560
17585
 
17561
17586
  tool = row.nextElementSibling.querySelector('.is-rowadd-tool');
17562
- row.nextElementSibling.removeChild(tool); //remove next row tool
17587
+ row.nextElementSibling.removeChild(tool); //remove
17588
+
17589
+ tool = row.nextElementSibling.querySelector('.is-col-tool');
17590
+ row.nextElementSibling.removeChild(tool); //remove
17563
17591
 
17564
17592
  row.nextElementSibling.appendChild(cell); //add
17565
17593
 
@@ -17569,7 +17597,6 @@ class Grid {
17569
17597
  let builderActive = this.builder.doc.querySelector('.builder-active');
17570
17598
  builder.applyBehaviorOn(builderActive);
17571
17599
  setTimeout(() => {
17572
- columnTool.position(cell);
17573
17600
  cell.click(); //refresh active cell/row
17574
17601
  }, 30);
17575
17602
  this.builder.opts.onChange();
@@ -17588,7 +17615,6 @@ class Grid {
17588
17615
  let builderActive = this.builder.doc.querySelector('.builder-active');
17589
17616
  builder.applyBehaviorOn(builderActive);
17590
17617
  setTimeout(() => {
17591
- columnTool.position(cell);
17592
17618
  cell.click(); //refresh active cell/row
17593
17619
  }, 30);
17594
17620
  this.builder.opts.onChange();
@@ -17603,7 +17629,6 @@ class Grid {
17603
17629
 
17604
17630
  duplicateColumn() {
17605
17631
  let builder = this.builder;
17606
- let columnTool = this.columnTool;
17607
17632
  let util = this.util;
17608
17633
  let dom = this.dom;
17609
17634
  const cell = util.cellSelected();
@@ -17619,10 +17644,10 @@ class Grid {
17619
17644
  }
17620
17645
 
17621
17646
  let row = cell.parentNode;
17622
- let num = 2; //is-row-tool & is-rowadd-tool
17647
+ let num = 3;
17623
17648
 
17624
17649
  if (row.querySelector('.is-row-overlay')) {
17625
- num = 3; //is-row-tool, is-rowadd-tool & is-row-overlay
17650
+ num = 4;
17626
17651
  }
17627
17652
 
17628
17653
  let maxCols = 4;
@@ -17632,7 +17657,6 @@ class Grid {
17632
17657
  }
17633
17658
 
17634
17659
  if (row.childElementCount >= maxCols + num) {
17635
- //+2 => is-row-tool & is-rowadd-tool
17636
17660
  alert(util.out('You have reached the maximum number of columns'));
17637
17661
  return false;
17638
17662
  }
@@ -17643,32 +17667,27 @@ class Grid {
17643
17667
  let builderActive = this.builder.doc.querySelector('.builder-active');
17644
17668
  builder.applyBehaviorOn(builderActive);
17645
17669
  setTimeout(() => {
17646
- columnTool.position(cell);
17647
17670
  cell.click(); //refresh active cell/row
17648
17671
  }, 30);
17649
17672
  this.builder.opts.onChange();
17650
17673
  }
17651
17674
 
17652
17675
  removeColumn() {
17653
- let columnTool = this.columnTool;
17654
17676
  let util = this.util;
17655
17677
  const cell = util.cellSelected();
17656
17678
  if (!cell) return;
17657
17679
  let row = cell.parentNode;
17658
- let num = 2; //is-row-tool & is-rowadd-tool
17680
+ let num = 3;
17659
17681
 
17660
17682
  if (row.querySelector('.is-row-overlay')) {
17661
- num = 3; //is-row-tool, is-rowadd-tool & is-row-overlay
17683
+ num = 4;
17662
17684
  }
17663
17685
 
17664
- columnTool.hide(); //Hide Column tool
17665
-
17666
17686
  util.confirm(util.out('Are you sure you want to delete this block?'), ok => {
17667
17687
  if (ok) {
17668
17688
  this.builder.uo.saveForUndo();
17669
17689
 
17670
17690
  if (row.childElementCount - num === 1) {
17671
- //-2 => minus is-row-tool & is-rowadd-tool
17672
17691
  row.parentNode.removeChild(row);
17673
17692
  util.checkEmpty();
17674
17693
  } else {
@@ -17678,18 +17697,12 @@ class Grid {
17678
17697
 
17679
17698
  util.clearActiveCell();
17680
17699
  this.builder.opts.onChange();
17681
- } else {
17682
- setTimeout(() => {
17683
- // columnTool.position(cell);
17684
- columnTool.show();
17685
- }, 30);
17686
17700
  }
17687
17701
  });
17688
17702
  }
17689
17703
 
17690
17704
  increaseColumn() {
17691
17705
  let builder = this.builder;
17692
- let columnTool = this.columnTool;
17693
17706
  let util = this.util;
17694
17707
  let dom = this.dom;
17695
17708
  const cell = util.cellSelected();
@@ -17726,7 +17739,6 @@ class Grid {
17726
17739
  dom.addClass(cell, group[j + 1][0]);
17727
17740
  dom.addClass(cellnext, group[j + 1][1]);
17728
17741
  dom.addClass(cellnext2, group[j + 1][2]);
17729
- columnTool.position(cell);
17730
17742
  this.builder.opts.onChange();
17731
17743
  return;
17732
17744
  }
@@ -17748,7 +17760,6 @@ class Grid {
17748
17760
  dom.removeClass(cellnext, group[j][1]);
17749
17761
  dom.addClass(cell, group[j + 1][0]);
17750
17762
  dom.addClass(cellnext, group[j + 1][1]);
17751
- columnTool.position(cell);
17752
17763
  this.builder.opts.onChange();
17753
17764
  return;
17754
17765
  }
@@ -17757,7 +17768,6 @@ class Grid {
17757
17768
  }
17758
17769
  }
17759
17770
 
17760
- columnTool.position(cell);
17761
17771
  return;
17762
17772
  } //others (12 columns grid)
17763
17773
 
@@ -17845,7 +17855,6 @@ class Grid {
17845
17855
  dom.addClass(cellnext, colClass[10]);
17846
17856
  }
17847
17857
 
17848
- columnTool.position(cell);
17849
17858
  this.builder.opts.onChange();
17850
17859
  }
17851
17860
  }
@@ -17853,7 +17862,6 @@ class Grid {
17853
17862
 
17854
17863
  decreaseColumn() {
17855
17864
  let builder = this.builder;
17856
- let columnTool = this.columnTool;
17857
17865
  let util = this.util;
17858
17866
  let dom = this.dom;
17859
17867
  const cell = util.cellSelected();
@@ -17890,7 +17898,6 @@ class Grid {
17890
17898
  dom.addClass(cell, group[j - 1][0]);
17891
17899
  dom.addClass(cellnext, group[j - 1][1]);
17892
17900
  dom.addClass(cellnext2, group[j - 1][2]);
17893
- columnTool.position(cell);
17894
17901
  this.builder.opts.onChange();
17895
17902
  return;
17896
17903
  }
@@ -17912,7 +17919,6 @@ class Grid {
17912
17919
  dom.removeClass(cellnext, group[j][1]);
17913
17920
  dom.addClass(cell, group[j - 1][0]);
17914
17921
  dom.addClass(cellnext, group[j - 1][1]);
17915
- columnTool.position(cell);
17916
17922
  this.builder.opts.onChange();
17917
17923
  return;
17918
17924
  }
@@ -17921,7 +17927,6 @@ class Grid {
17921
17927
  }
17922
17928
  }
17923
17929
 
17924
- columnTool.position(cell);
17925
17930
  return;
17926
17931
  } //others (12 columns grid)
17927
17932
  // const rowClass = builder.opts.row; //row
@@ -18011,7 +18016,6 @@ class Grid {
18011
18016
  dom.addClass(cellnext, colClass[11]);
18012
18017
  }
18013
18018
 
18014
- columnTool.position(cell);
18015
18019
  this.builder.opts.onChange();
18016
18020
  }
18017
18021
  }
@@ -18020,7 +18024,6 @@ class Grid {
18020
18024
 
18021
18025
  removeRow() {
18022
18026
  // let builder = this.builder;
18023
- // let columnTool = this.columnTool;
18024
18027
  let util = this.util;
18025
18028
  let dom = this.dom; // const cell = util.cellSelected();
18026
18029
  // if(!cell) return;
@@ -18038,8 +18041,6 @@ class Grid {
18038
18041
  if (!row) return; //Change to row selection
18039
18042
 
18040
18043
  dom.removeClass(row, 'row-outline');
18041
- this.columnTool.hide(); //Hide Column tool
18042
-
18043
18044
  util.confirm(util.out('Are you sure you want to delete this block?'), ok => {
18044
18045
  // const cell = util.cellSelected();
18045
18046
  // if(!cell) return;
@@ -18066,7 +18067,6 @@ class Grid {
18066
18067
 
18067
18068
  moveRowUp() {
18068
18069
  // let builder = this.builder;
18069
- let columnTool = this.columnTool;
18070
18070
  let util = this.util;
18071
18071
  let dom = this.dom; // const cell = util.cellSelected();
18072
18072
  // if(!cell) return;
@@ -18084,7 +18084,6 @@ class Grid {
18084
18084
  if (!row) return; //Change to row selection
18085
18085
 
18086
18086
  dom.removeClass(row, 'row-outline');
18087
- columnTool.hide(); //Hide Column tool
18088
18087
 
18089
18088
  if (row.previousElementSibling) {
18090
18089
  this.builder.uo.saveForUndo();
@@ -18114,7 +18113,6 @@ class Grid {
18114
18113
 
18115
18114
  moveRowDown() {
18116
18115
  // let builder = this.builder;
18117
- let columnTool = this.columnTool;
18118
18116
  let util = this.util;
18119
18117
  let dom = this.dom; // const cell = util.cellSelected();
18120
18118
  // if(!cell) return;
@@ -18132,7 +18130,6 @@ class Grid {
18132
18130
  if (!row) return; //Change to row selection
18133
18131
 
18134
18132
  dom.removeClass(row, 'row-outline');
18135
- columnTool.hide(); //Hide Column tool
18136
18133
 
18137
18134
  if (row.nextElementSibling) {
18138
18135
  this.builder.uo.saveForUndo();
@@ -18162,7 +18159,6 @@ class Grid {
18162
18159
 
18163
18160
  duplicateRow() {
18164
18161
  let builder = this.builder;
18165
- let columnTool = this.columnTool;
18166
18162
  let util = this.util;
18167
18163
  let dom = this.dom; // const cell = util.cellSelected();
18168
18164
  // if(!cell) return;
@@ -18180,12 +18176,11 @@ class Grid {
18180
18176
  if (!row) return; //Change to row selection
18181
18177
 
18182
18178
  dom.removeClass(row, 'row-outline');
18183
- columnTool.hide(); //Hide Column tool
18184
-
18185
18179
  this.builder.uo.saveForUndo(); //Clone row & cleanup attached tool & event
18186
18180
 
18187
18181
  const rowElement = row.cloneNode(true);
18188
18182
  rowElement.removeChild(rowElement.querySelector('.is-row-tool'));
18183
+ rowElement.removeChild(rowElement.querySelector('.is-col-tool'));
18189
18184
  let cols = dom.elementChildren(rowElement);
18190
18185
  cols.forEach(col => {
18191
18186
  col.removeAttribute('data-click');
@@ -18207,22 +18202,6 @@ class Grid {
18207
18202
  builder.applyBehaviorOn(builderActive);
18208
18203
  this.rowTool.position(rowElement);
18209
18204
  this.builder.opts.onChange();
18210
- } // Utilities
18211
-
18212
-
18213
- refreshColumnTool(cell) {
18214
- let columnTool = this.columnTool;
18215
- columnTool.position(cell);
18216
- }
18217
-
18218
- showColumnTool() {
18219
- let columnTool = this.columnTool;
18220
- columnTool.show();
18221
- }
18222
-
18223
- hideColumnTool() {
18224
- let columnTool = this.columnTool;
18225
- columnTool.hide();
18226
18205
  }
18227
18206
 
18228
18207
  }
@@ -18281,76 +18260,6 @@ class RowTool$1 {
18281
18260
 
18282
18261
  }
18283
18262
 
18284
- class ColumnTool$1 {
18285
- constructor(builder) {
18286
- this.builder = builder;
18287
- const dom = this.builder.dom;
18288
- this.dom = dom;
18289
- }
18290
-
18291
- position(col) {
18292
- let dom = this.dom;
18293
- const builderStuff = this.builder.builderStuff; // this.columnTool = builderStuff.querySelector('.is-column-tool');
18294
-
18295
- if (!this.builder.iframe) {
18296
- this.columnTool = builderStuff.querySelector('.is-column-tool');
18297
- } else {
18298
- this.columnTool = this.builder.contentStuff.querySelector('.is-column-tool');
18299
- }
18300
-
18301
- this.columnMore = builderStuff.querySelector('.columnmore');
18302
- dom.addClass(this.columnMore, 'transition1');
18303
- setTimeout(() => {
18304
- this.columnTool.style.top = col.getBoundingClientRect().top - 29 + this.builder.win.pageYOffset + 'px';
18305
- this.columnTool.style.left = col.getBoundingClientRect().left - 1 + 'px';
18306
- let top, left;
18307
-
18308
- if (!this.builder.iframe) {
18309
- top = parseInt(this.columnTool.style.top);
18310
- left = parseInt(this.columnTool.style.left);
18311
- } else {
18312
- let adjY = this.builder.iframe.getBoundingClientRect().top + window.pageYOffset;
18313
- let adjX = this.builder.iframe.getBoundingClientRect().left + window.pageXOffset;
18314
- top = parseInt(this.columnTool.style.top) - this.builder.win.pageYOffset + adjY;
18315
- left = parseInt(this.columnTool.style.left) - this.builder.win.pageXOffset + adjX;
18316
- }
18317
-
18318
- this.columnMore.style.top = top + 35 + 'px';
18319
- this.columnMore.style.left = left + 19 + 'px';
18320
- setTimeout(() => {
18321
- dom.removeClass(this.columnMore, 'transition1');
18322
- }, 300);
18323
- }, 30);
18324
- }
18325
-
18326
- hide() {
18327
- let dom = this.dom;
18328
- const builderStuff = this.builder.builderStuff;
18329
-
18330
- if (!this.builder.iframe) {
18331
- this.columnTool = builderStuff.querySelector('.is-column-tool');
18332
- } else {
18333
- this.columnTool = this.builder.contentStuff.querySelector('.is-column-tool');
18334
- }
18335
-
18336
- dom.removeClass(this.columnTool, 'active');
18337
- }
18338
-
18339
- show() {
18340
- let dom = this.dom;
18341
- const builderStuff = this.builder.builderStuff;
18342
-
18343
- if (!this.builder.iframe) {
18344
- this.columnTool = builderStuff.querySelector('.is-column-tool');
18345
- } else {
18346
- this.columnTool = this.builder.contentStuff.querySelector('.is-column-tool');
18347
- }
18348
-
18349
- dom.addClass(this.columnTool, 'active');
18350
- }
18351
-
18352
- }
18353
-
18354
18263
  /*
18355
18264
  Draggable
18356
18265
  Insipred by: https://www.kirupa.com/html5/drag.htm
@@ -49586,18 +49495,7 @@ class Image$1 {
49586
49495
  document.selection.empty();
49587
49496
  } else {
49588
49497
  window.getSelection().removeAllRanges();
49589
- } // Hide column tool
49590
-
49591
-
49592
- let columnTool;
49593
-
49594
- if (!this.builder.iframe) {
49595
- columnTool = builderStuff.querySelector('.is-column-tool');
49596
- } else {
49597
- columnTool = contentStuff.querySelector('.is-column-tool');
49598
49498
  }
49599
-
49600
- dom.removeClass(columnTool, 'active');
49601
49499
  }).on('resizeEnd', ({
49602
49500
  target
49603
49501
  }) => {
@@ -49642,17 +49540,7 @@ class Image$1 {
49642
49540
  target.setAttribute('data-resized', 0);
49643
49541
  }, 300); //Trigger Change event
49644
49542
 
49645
- this.builder.opts.onChange(); // Show column tool
49646
-
49647
- let columnTool;
49648
-
49649
- if (!this.builder.iframe) {
49650
- columnTool = builderStuff.querySelector('.is-column-tool');
49651
- } else {
49652
- columnTool = contentStuff.querySelector('.is-column-tool');
49653
- }
49654
-
49655
- dom.addClass(columnTool, 'active');
49543
+ this.builder.opts.onChange();
49656
49544
  });
49657
49545
  document.querySelector('.moveable-control-box').style.display = 'none';
49658
49546
  imageResizer.addEventListener('click', () => {
@@ -53504,6 +53392,7 @@ class Code {
53504
53392
  elms = tmpbuilder.querySelectorAll('[data-module-active]');
53505
53393
  dom.removeAttributes(elms, 'data-module-active');
53506
53394
  dom.removeElements(tmpbuilder.querySelectorAll('.is-row-tool'));
53395
+ dom.removeElements(tmpbuilder.querySelectorAll('.is-col-tool'));
53507
53396
  dom.removeElements(tmpbuilder.querySelectorAll('.is-rowadd-tool'));
53508
53397
  dom.removeElements(tmpbuilder.querySelectorAll('.ovl'));
53509
53398
  dom.removeElements(tmpbuilder.querySelectorAll('.row-add-initial'));
@@ -55153,7 +55042,13 @@ class RowTool {
55153
55042
  <button type="button" tabindex="-1" title="${util.out('More')}" class="row-more"><svg class="is-icon-flex"><use xlink:href="#ion-more"></use></svg></button>
55154
55043
  <button type="button" tabindex="-1" title="${util.out('Grid Editor')}" class="row-grideditor"><svg class="is-icon-flex"><use xlink:href="#ion-grid"></use></svg></button>
55155
55044
  <button type="button" tabindex="-1" title="${util.out('Delete')}" class="row-remove"><svg class="is-icon-flex"><use xlink:href="#ion-ios-close-empty"></use></svg></button>
55156
- </div>`;
55045
+ </div>
55046
+ <div class="is-tool is-col-tool">
55047
+ <button type="button" tabindex="-1" title="${util.out('Add')}" class="cell-add"><svg class="is-icon-flex"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>
55048
+ <button type="button" tabindex="-1" title="${util.out('More')}" class="cell-more"><svg class="is-icon-flex"><use xlink:href="#ion-more"></use></svg></button>
55049
+ <button type="button" tabindex="-1" title="${util.out('Delete')}" class="cell-remove"><svg class="is-icon-flex" style="margin-left:-1px"><use xlink:href="#ion-ios-close-empty"></use></svg></button>
55050
+ </div>
55051
+ `;
55157
55052
  dom.appendHtml(row, html);
55158
55053
  rowtool = row.querySelector('.is-row-tool'); // Prepare for tooltip
55159
55054
 
@@ -55167,6 +55062,109 @@ class RowTool {
55167
55062
  this.builder.tooltip.set(elm, 5, 3, true);
55168
55063
  }
55169
55064
  });
55065
+ let coltool = row.querySelector('.is-col-tool'); // Prepare for tooltip
55066
+
55067
+ elms = coltool.querySelectorAll('[title]');
55068
+ Array.prototype.forEach.call(elms, elm => {
55069
+ elm.setAttribute('data-title', elm.getAttribute('title'));
55070
+
55071
+ if (!this.builder.iframe) {
55072
+ this.builder.tooltip.set(elm, 5, 3);
55073
+ } else {
55074
+ this.builder.tooltip.set(elm, 5, 3, true);
55075
+ }
55076
+ }); // Check for backward compatibility
55077
+
55078
+ let marginLeft = window.getComputedStyle(coltool, null).getPropertyValue('margin-left');
55079
+
55080
+ if (parseInt(marginLeft) === 0) {
55081
+ this.builder.backwardCompatible();
55082
+ }
55083
+
55084
+ const btnCellAdd = coltool.querySelector('.cell-add');
55085
+ if (btnCellAdd) dom.addEventListener(btnCellAdd, 'click', () => {
55086
+ let cell = util.cellSelected();
55087
+ if (!cell) return;
55088
+ let quickadd = this.builder.builderStuff.querySelector('.is-pop.quickadd');
55089
+ let tabs = quickadd.querySelector('.is-pop-tabs');
55090
+ tabs.style.display = 'flex';
55091
+ let top, left;
55092
+
55093
+ if (!this.builder.iframe) {
55094
+ top = btnCellAdd.getBoundingClientRect().top + window.pageYOffset;
55095
+ left = btnCellAdd.getBoundingClientRect().left + window.pageXOffset;
55096
+ } else {
55097
+ let adjY = this.builder.iframe.getBoundingClientRect().top + window.pageYOffset;
55098
+ let adjX = this.builder.iframe.getBoundingClientRect().left + window.pageXOffset;
55099
+ top = btnCellAdd.getBoundingClientRect().top + adjY + 10;
55100
+ left = btnCellAdd.getBoundingClientRect().left + adjX + 5;
55101
+ } // quickadd.style.display = 'flex';
55102
+
55103
+
55104
+ util.showPop(quickadd, false, btnCellAdd); //const w = quickadd.offsetWidth; //to get value, element must not hidden (display:none). So set display:flex before this.
55105
+ //const h = quickadd.offsetHeight;
55106
+
55107
+ quickadd.style.top = top + 35 + 'px';
55108
+ quickadd.style.left = left + 'px';
55109
+ dom.removeClass(quickadd, 'arrow-bottom');
55110
+ dom.removeClass(quickadd, 'arrow-left');
55111
+ dom.removeClass(quickadd, 'arrow-right');
55112
+ dom.removeClass(quickadd, 'center');
55113
+ dom.removeClass(quickadd, 'right');
55114
+ dom.addClass(quickadd, 'arrow-top');
55115
+ dom.addClass(quickadd, 'left');
55116
+ let val = quickadd.querySelector('.active').getAttribute('data-value');
55117
+
55118
+ if (val === 'left') {
55119
+ quickadd.setAttribute('data-mode', 'cell-left');
55120
+ } else {
55121
+ quickadd.setAttribute('data-mode', 'cell-right');
55122
+ }
55123
+ });
55124
+ const btnCellMore = coltool.querySelector('.cell-more');
55125
+ if (btnCellMore) dom.addEventListener(btnCellMore, 'click', () => {
55126
+ let cell = util.cellSelected();
55127
+ if (!cell) return;
55128
+ let top, left;
55129
+
55130
+ if (!this.builder.iframe) {
55131
+ top = btnCellMore.getBoundingClientRect().top + window.pageYOffset;
55132
+ left = btnCellMore.getBoundingClientRect().left + window.pageXOffset;
55133
+ } else {
55134
+ let adjY = this.builder.iframe.getBoundingClientRect().top + window.pageYOffset;
55135
+ let adjX = this.builder.iframe.getBoundingClientRect().left + window.pageXOffset;
55136
+ top = btnCellMore.getBoundingClientRect().top + adjY;
55137
+ left = btnCellMore.getBoundingClientRect().left + adjX;
55138
+ }
55139
+
55140
+ const columnMore = builderStuff.querySelector('.columnmore'); // columnMore.style.display = 'flex';
55141
+
55142
+ util.showPop(columnMore, false, btnCellMore); //const w = columnMore.offsetWidth; //to get value, element must not hidden (display:none). So set display:flex before this.
55143
+ //const h = columnMore.offsetHeight;
55144
+
55145
+ columnMore.style.top = top + 35 + 'px';
55146
+ columnMore.style.left = left - 7 + 'px';
55147
+ dom.removeClass(columnMore, 'arrow-bottom');
55148
+ dom.removeClass(columnMore, 'arrow-left');
55149
+ dom.removeClass(columnMore, 'arrow-right');
55150
+ dom.removeClass(columnMore, 'center');
55151
+ dom.removeClass(columnMore, 'right');
55152
+ dom.addClass(columnMore, 'arrow-top');
55153
+ dom.addClass(columnMore, 'left');
55154
+ const btnCellLocking = columnMore.querySelector('.cell-locking');
55155
+
55156
+ if (cell.hasAttribute('data-noedit')) {
55157
+ dom.addClass(btnCellLocking, 'on'); // btnCellLocking.innerHTML = '<svg class="is-icon-flex"><use xlink:href="#icon-lock"></use></svg>';
55158
+ } else {
55159
+ dom.removeClass(btnCellLocking, 'on'); // btnCellLocking.innerHTML = '<svg class="is-icon-flex"><use xlink:href="#icon-lock-off"></use></svg>';
55160
+ }
55161
+ });
55162
+ const btnCellRemove = coltool.querySelector('.cell-remove');
55163
+ if (btnCellRemove) dom.addEventListener(btnCellRemove, 'click', () => {
55164
+ const grid = new Grid(this.builder);
55165
+ grid.removeColumn();
55166
+ util.clearControls();
55167
+ });
55170
55168
  let btnGridEditor = rowtool.querySelector('.row-grideditor');
55171
55169
  if (btnGridEditor) dom.addEventListener(btnGridEditor, 'click', () => {
55172
55170
  const grideditor = builderStuff.querySelector('.grideditor');
@@ -55227,10 +55225,9 @@ class RowTool {
55227
55225
 
55228
55226
  if (!row) return; //Change to row selection
55229
55227
 
55230
- dom.removeClass(row, 'row-outline'); //Hide Column tool
55228
+ dom.removeClass(row, 'row-outline'); //Hide Column tool (new!)
55231
55229
 
55232
- let columnTool = builderStuff.querySelector('.is-column-tool');
55233
- dom.removeClass(columnTool, 'active'); // const top = btnMore.getBoundingClientRect().top + window.pageYOffset;
55230
+ util.hideColumnTool(); // const top = btnMore.getBoundingClientRect().top + window.pageYOffset;
55234
55231
  // const left = btnMore.getBoundingClientRect().left + window.pageXOffset;
55235
55232
 
55236
55233
  let top, left;
@@ -57164,8 +57161,7 @@ class ColumnTool {
57164
57161
  this.util = util;
57165
57162
  const dom = this.builder.dom;
57166
57163
  this.dom = dom;
57167
- let columnTool = builderStuff.querySelector('.is-column-tool');
57168
- let columnMore;
57164
+ let columnMore = builderStuff.querySelector('.is-pop.columnmore');
57169
57165
  let resizebutton = `
57170
57166
  <button type="button" title="${util.out('Increase')}" class="cell-increase"><span><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#icon-increase"></use></svg></span>${util.out('Increase')}</button>
57171
57167
  <button type="button" title="${util.out('Decrease')}" class="cell-decrease"><span><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#icon-decrease"></use></svg></span>${util.out('Decrease')}</button>
@@ -57176,8 +57172,10 @@ class ColumnTool {
57176
57172
  <span><svg class="is-icon-flex" style="margin-right:-3px;width:12px;height:12px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:12px;height:12px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></span>${util.out('HTML')}
57177
57173
  </button>`;
57178
57174
 
57179
- if (!columnTool) {
57180
- let html = `<div class="is-tool is-column-tool">
57175
+ if (!columnMore) {
57176
+ // .is-column-tool here is not used anymore and is replaced with the one in rowtool.js
57177
+ let html = `
57178
+ <div class="is-tool is-column-tool">
57181
57179
  <button type="button" tabindex="-1" title="${util.out('Add')}" class="cell-add"><svg class="is-icon-flex"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>
57182
57180
  <button type="button" tabindex="-1" title="${util.out('More')}" class="cell-more"><svg class="is-icon-flex"><use xlink:href="#ion-more"></use></svg></button>
57183
57181
  <button type="button" tabindex="-1" title="${util.out('Delete')}" class="cell-remove"><svg class="is-icon-flex" style="margin-left:-1px"><use xlink:href="#ion-ios-close-empty"></use></svg></button>
@@ -57495,10 +57493,8 @@ class ColumnTool {
57495
57493
  dom.appendHtml(builderStuff, html);
57496
57494
 
57497
57495
  if (!this.builder.iframe) {
57498
- columnTool = builderStuff.querySelector('.is-column-tool');
57499
57496
  this.lockIndicator = builderStuff.querySelector('.is-locked-indicator');
57500
57497
  } else {
57501
- columnTool = this.builder.contentStuff.querySelector('.is-column-tool');
57502
57498
  this.lockIndicator = this.builder.contentStuff.querySelector('.is-locked-indicator');
57503
57499
  }
57504
57500
 
@@ -57506,100 +57502,8 @@ class ColumnTool {
57506
57502
  this.cellSettings = builderStuff.querySelector('.is-modal.columnsettings');
57507
57503
  this.divCellClick = builderStuff.querySelector('#divCellClick');
57508
57504
  this.divCellGeneral = builderStuff.querySelector('#divCellGeneral');
57509
- const quickadd = renderQuickAdd(builder); // Prepare for tooltip
57510
-
57511
- let elms = columnTool.querySelectorAll('[title]');
57512
- Array.prototype.forEach.call(elms, elm => {
57513
- elm.setAttribute('data-title', elm.getAttribute('title'));
57514
- }); // elms = columnMore.querySelectorAll('[title]');
57515
- // Array.prototype.forEach.call(elms, (elm) => {
57516
- // elm.setAttribute('data-title',elm.getAttribute('title'));
57517
- // });
57518
- // Add column
57519
-
57520
- let btnCellAdd = columnTool.querySelector('.cell-add');
57521
- dom.addEventListener(btnCellAdd, 'click', () => {
57522
- let cell = util.cellSelected();
57523
- if (!cell) return;
57524
- let tabs = quickadd.querySelector('.is-pop-tabs');
57525
- tabs.style.display = 'flex';
57526
- let top, left;
57527
-
57528
- if (!this.builder.iframe) {
57529
- top = btnCellAdd.getBoundingClientRect().top + window.pageYOffset;
57530
- left = btnCellAdd.getBoundingClientRect().left + window.pageXOffset;
57531
- } else {
57532
- let adjY = this.builder.iframe.getBoundingClientRect().top + window.pageYOffset;
57533
- let adjX = this.builder.iframe.getBoundingClientRect().left + window.pageXOffset;
57534
- top = btnCellAdd.getBoundingClientRect().top + adjY + 10;
57535
- left = btnCellAdd.getBoundingClientRect().left + adjX + 5;
57536
- } // quickadd.style.display = 'flex';
57537
-
57538
-
57539
- util.showPop(quickadd, false, btnCellAdd); //const w = quickadd.offsetWidth; //to get value, element must not hidden (display:none). So set display:flex before this.
57540
- //const h = quickadd.offsetHeight;
57541
-
57542
- quickadd.style.top = top + 35 + 'px';
57543
- quickadd.style.left = left + 'px';
57544
- dom.removeClass(quickadd, 'arrow-bottom');
57545
- dom.removeClass(quickadd, 'arrow-left');
57546
- dom.removeClass(quickadd, 'arrow-right');
57547
- dom.removeClass(quickadd, 'center');
57548
- dom.removeClass(quickadd, 'right');
57549
- dom.addClass(quickadd, 'arrow-top');
57550
- dom.addClass(quickadd, 'left');
57551
- let val = quickadd.querySelector('.active').getAttribute('data-value');
57552
-
57553
- if (val === 'left') {
57554
- quickadd.setAttribute('data-mode', 'cell-left');
57555
- } else {
57556
- quickadd.setAttribute('data-mode', 'cell-right');
57557
- }
57558
- }); // More
57559
-
57560
- const btnCellMore = columnTool.querySelector('.cell-more');
57561
- dom.addEventListener(btnCellMore, 'click', () => {
57562
- let cell = util.cellSelected();
57563
- if (!cell) return;
57564
- let top, left;
57565
-
57566
- if (!this.builder.iframe) {
57567
- top = btnCellMore.getBoundingClientRect().top + window.pageYOffset;
57568
- left = btnCellMore.getBoundingClientRect().left + window.pageXOffset;
57569
- } else {
57570
- let adjY = this.builder.iframe.getBoundingClientRect().top + window.pageYOffset;
57571
- let adjX = this.builder.iframe.getBoundingClientRect().left + window.pageXOffset;
57572
- top = btnCellMore.getBoundingClientRect().top + adjY;
57573
- left = btnCellMore.getBoundingClientRect().left + adjX;
57574
- } // columnMore.style.display = 'flex';
57575
-
57576
-
57577
- util.showPop(columnMore, false, btnCellMore); //const w = columnMore.offsetWidth; //to get value, element must not hidden (display:none). So set display:flex before this.
57578
- //const h = columnMore.offsetHeight;
57579
-
57580
- columnMore.style.top = top + 35 + 'px';
57581
- columnMore.style.left = left - 7 + 'px';
57582
- dom.removeClass(columnMore, 'arrow-bottom');
57583
- dom.removeClass(columnMore, 'arrow-left');
57584
- dom.removeClass(columnMore, 'arrow-right');
57585
- dom.removeClass(columnMore, 'center');
57586
- dom.removeClass(columnMore, 'right');
57587
- dom.addClass(columnMore, 'arrow-top');
57588
- dom.addClass(columnMore, 'left');
57589
- const btnCellLocking = this.columnMore.querySelector('.cell-locking');
57590
-
57591
- if (cell.hasAttribute('data-noedit')) {
57592
- dom.addClass(btnCellLocking, 'on'); // btnCellLocking.innerHTML = '<svg class="is-icon-flex"><use xlink:href="#icon-lock"></use></svg>';
57593
- } else {
57594
- dom.removeClass(btnCellLocking, 'on'); // btnCellLocking.innerHTML = '<svg class="is-icon-flex"><use xlink:href="#icon-lock-off"></use></svg>';
57595
- }
57596
- }); // Delete column
57597
-
57598
- let elm = columnTool.querySelector('.cell-remove');
57599
- dom.addEventListener(elm, 'click', () => {
57600
- this.grid.removeColumn();
57601
- util.clearControls();
57602
- }); // Move Previous
57505
+ renderQuickAdd(builder);
57506
+ let elms, elm; // Move Previous
57603
57507
 
57604
57508
  elm = columnMore.querySelector('.cell-prev');
57605
57509
  dom.addEventListener(elm, 'click', () => {
@@ -57633,6 +57537,7 @@ class ColumnTool {
57633
57537
  Array.from(row.children).map(item => {
57634
57538
  if (item.classList.contains('is-row-tool')) return;
57635
57539
  if (item.classList.contains('is-rowadd-tool')) return;
57540
+ if (item.classList.contains('is-col-tool')) return;
57636
57541
  if (item.style.width) needed = true;
57637
57542
  });
57638
57543
 
@@ -57640,6 +57545,7 @@ class ColumnTool {
57640
57545
  Array.from(row.children).map(item => {
57641
57546
  if (item.classList.contains('is-row-tool')) return;
57642
57547
  if (item.classList.contains('is-rowadd-tool')) return;
57548
+ if (item.classList.contains('is-col-tool')) return;
57643
57549
  item.style.width = '';
57644
57550
  item.style.flex = '';
57645
57551
  item.style.height = '';
@@ -57653,6 +57559,7 @@ class ColumnTool {
57653
57559
  Array.from(cell.parentNode.children).map(item => {
57654
57560
  if (item.classList.contains('is-row-tool')) return;
57655
57561
  if (item.classList.contains('is-rowadd-tool')) return;
57562
+ if (item.classList.contains('is-col-tool')) return;
57656
57563
 
57657
57564
  if (item.getAttribute('data-module')) {
57658
57565
  util.refreshModuleLayout(item);
@@ -57670,6 +57577,7 @@ class ColumnTool {
57670
57577
  Array.from(row.children).map(item => {
57671
57578
  if (item.classList.contains('is-row-tool')) return;
57672
57579
  if (item.classList.contains('is-rowadd-tool')) return;
57580
+ if (item.classList.contains('is-col-tool')) return;
57673
57581
  if (item.style.width) needed = true;
57674
57582
  });
57675
57583
 
@@ -57677,6 +57585,7 @@ class ColumnTool {
57677
57585
  Array.from(row.children).map(item => {
57678
57586
  if (item.classList.contains('is-row-tool')) return;
57679
57587
  if (item.classList.contains('is-rowadd-tool')) return;
57588
+ if (item.classList.contains('is-col-tool')) return;
57680
57589
  item.style.width = '';
57681
57590
  item.style.flex = '';
57682
57591
  item.style.height = '';
@@ -57690,6 +57599,7 @@ class ColumnTool {
57690
57599
  Array.from(cell.parentNode.children).map(item => {
57691
57600
  if (item.classList.contains('is-row-tool')) return;
57692
57601
  if (item.classList.contains('is-rowadd-tool')) return;
57602
+ if (item.classList.contains('is-col-tool')) return;
57693
57603
 
57694
57604
  if (item.getAttribute('data-module')) {
57695
57605
  util.refreshModuleLayout(item);
@@ -58814,7 +58724,6 @@ class ColumnTool {
58814
58724
  });
58815
58725
  }
58816
58726
 
58817
- this.columnTool = columnTool;
58818
58727
  this.columnMore = columnMore;
58819
58728
  }
58820
58729
 
@@ -59385,10 +59294,11 @@ class ColumnTool {
59385
59294
  }
59386
59295
 
59387
59296
  click(col) {
59388
- const dom = this.dom;
59389
- dom.addClass(this.columnTool, 'active');
59390
- this.columnTool.style.top = col.getBoundingClientRect().top - 29 + this.builder.win.pageYOffset + 'px';
59391
- this.columnTool.style.left = col.getBoundingClientRect().left - 1 + 'px';
59297
+ const dom = this.dom; //---- New Col Tool ----
59298
+
59299
+ this.columnTool = col.parentNode.querySelector('.is-col-tool');
59300
+ this.columnTool.style.left = col.offsetLeft + 'px'; //---- /New Col Tool ----
59301
+
59392
59302
  const btnIncrease = this.columnMore.querySelector('.cell-increase');
59393
59303
  const btnDecrease = this.columnMore.querySelector('.cell-decrease');
59394
59304
  let nogrid = dom.parentsHasAttribute(col, 'nogrid');
@@ -59448,14 +59358,14 @@ class ColumnTool {
59448
59358
  this.columnTool.querySelector('.cell-add').removeAttribute('disabled');
59449
59359
  this.columnTool.querySelector('.cell-remove').removeAttribute('disabled');
59450
59360
  let row = col.parentNode;
59451
- let num = 2; //is-row-tool & is-rowadd-tool
59361
+ let num = 3; //is-row-tool, is-col-tool & is-rowadd-tool
59452
59362
 
59453
59363
  if (row.querySelector('.is-row-overlay')) {
59454
- num = 3; //is-row-tool, is-rowadd-tool & is-row-overlay
59364
+ num = 4; //is-row-tool, is-col-tool, is-rowadd-tool & is-row-overlay
59455
59365
  }
59456
59366
 
59457
59367
  if (row.childElementCount - num === 1) {
59458
- //-num => minus is-row-tool, is-rowadd-tool & is-row-overlay
59368
+ //-num => minus is-row-tool, is-col-tool, is-rowadd-tool & is-row-overlay
59459
59369
  this.columnMore.querySelector('.cell-prev').style.display = 'none';
59460
59370
  this.columnMore.querySelector('.cell-next').style.display = 'none';
59461
59371
  if (btnIncrease) btnIncrease.style.display = 'none';
@@ -59578,18 +59488,6 @@ class ColumnTool {
59578
59488
  }
59579
59489
  }
59580
59490
 
59581
- refreshColumnTool(cell) {
59582
- this.grid.refreshColumnTool(cell);
59583
- }
59584
-
59585
- showColumnTool(cell) {
59586
- this.grid.showColumnTool(cell);
59587
- }
59588
-
59589
- hideColumnTool() {
59590
- this.grid.hideColumnTool();
59591
- }
59592
-
59593
59491
  }
59594
59492
 
59595
59493
  const dom$f = new Dom();
@@ -64506,18 +64404,13 @@ class ElementTool {
64506
64404
  if (cell) {
64507
64405
  let row = cell.parentNode;
64508
64406
 
64509
- if (cell.childElementCount === 0 && row.childElementCount === 3) {
64407
+ if (cell.childElementCount === 0 && row.childElementCount === 4) {
64408
+ // 4 => col + tools
64510
64409
  row.parentNode.removeChild(row);
64511
- let columnTool = builderStuff.querySelector('.is-column-tool'); // quick access
64512
-
64513
- dom.removeClass(columnTool, 'active');
64514
64410
  util.checkEmpty();
64515
64411
  } else if (cell.childElementCount === 0) {
64516
64412
  row.removeChild(cell);
64517
64413
  util.fixLayout(row);
64518
- let columnTool = builderStuff.querySelector('.is-column-tool'); // // quick access
64519
-
64520
- dom.removeClass(columnTool, 'active');
64521
64414
  }
64522
64415
  } // Add spacer to empty subblock
64523
64416
 
@@ -65626,22 +65519,16 @@ class Preferences {
65626
65519
  }
65627
65520
 
65628
65521
  setColumnTool(hidecolumntool) {
65629
- const builderStuff = this.builder.builderStuff;
65522
+ const builders = this.builder.doc.querySelectorAll(this.builder.opts.container);
65630
65523
 
65631
65524
  if (hidecolumntool) {
65632
- builderStuff.setAttribute('hidecolumntool', '');
65525
+ Array.prototype.forEach.call(builders, builder => {
65526
+ builder.setAttribute('hidecolumntool', '');
65527
+ });
65633
65528
  } else {
65634
- builderStuff.removeAttribute('hidecolumntool', '');
65635
- }
65636
-
65637
- if (this.builder.iframe) {
65638
- const contentStuff = this.builder.contentStuff;
65639
-
65640
- if (hidecolumntool) {
65641
- contentStuff.setAttribute('hidecolumntool', '');
65642
- } else {
65643
- contentStuff.removeAttribute('hidecolumntool', '');
65644
- }
65529
+ Array.prototype.forEach.call(builders, builder => {
65530
+ builder.removeAttribute('hidecolumntool');
65531
+ });
65645
65532
  }
65646
65533
  }
65647
65534
 
@@ -67288,12 +67175,14 @@ class Rte {
67288
67175
  Array.prototype.forEach.call(tools, tool => {
67289
67176
  tool.style.display = '';
67290
67177
  });
67291
- let tool = this.builder.doc.querySelector('.is-column-tool');
67292
- tool.style.display = 'none';
67293
67178
  tools = this.builder.doc.querySelectorAll('.is-row-tool');
67294
67179
  tools.forEach(tool => {
67295
67180
  tool.style.display = 'none';
67296
67181
  });
67182
+ tools = this.builder.doc.querySelectorAll('.is-col-tool');
67183
+ tools.forEach(tool => {
67184
+ tool.style.display = 'none';
67185
+ });
67297
67186
  tools = this.builder.doc.querySelectorAll('.is-rowadd-tool');
67298
67187
  tools.forEach(tool => {
67299
67188
  tool.style.opacity = 0;
@@ -67321,15 +67210,6 @@ class Rte {
67321
67210
 
67322
67211
 
67323
67212
  this.builder.elmTool.repositionElementTool();
67324
- let col = this.builder.activeCol;
67325
- let tool = this.builder.doc.querySelector('.is-column-tool');
67326
- tool.style.display = '';
67327
-
67328
- if (col) {
67329
- tool.style.top = col.getBoundingClientRect().top - 29 + window.pageYOffset + 'px';
67330
- tool.style.left = col.getBoundingClientRect().left - 1 + 'px';
67331
- }
67332
-
67333
67213
  let tools = this.builder.doc.querySelectorAll('.is-row-tool');
67334
67214
  tools.forEach(tool => {
67335
67215
  tool.style.display = '';
@@ -67338,6 +67218,10 @@ class Rte {
67338
67218
  tools.forEach(tool => {
67339
67219
  tool.style.opacity = '';
67340
67220
  });
67221
+ tools = this.builder.doc.querySelectorAll('.is-col-tool');
67222
+ tools.forEach(tool => {
67223
+ tool.style.display = '';
67224
+ });
67341
67225
 
67342
67226
  if (this.builder.onZoomEnd) {
67343
67227
  let val = this.rteZoomSlider.value;
@@ -67370,12 +67254,14 @@ class Rte {
67370
67254
  Array.prototype.forEach.call(tools, tool => {
67371
67255
  tool.style.display = '';
67372
67256
  });
67373
- let tool = this.builder.doc.querySelector('.is-column-tool');
67374
- tool.style.display = 'none';
67375
67257
  tools = this.builder.doc.querySelectorAll('.is-row-tool');
67376
67258
  tools.forEach(tool => {
67377
67259
  tool.style.display = 'none';
67378
67260
  });
67261
+ tools = this.builder.doc.querySelectorAll('.is-col-tool');
67262
+ tools.forEach(tool => {
67263
+ tool.style.display = 'none';
67264
+ });
67379
67265
  tools = this.builder.doc.querySelectorAll('.is-rowadd-tool');
67380
67266
  tools.forEach(tool => {
67381
67267
  tool.style.opacity = 0;
@@ -67403,15 +67289,6 @@ class Rte {
67403
67289
 
67404
67290
 
67405
67291
  this.builder.elmTool.repositionElementTool();
67406
- let col = this.builder.activeCol;
67407
- let tool = this.builder.doc.querySelector('.is-column-tool');
67408
- tool.style.display = '';
67409
-
67410
- if (col) {
67411
- tool.style.top = col.getBoundingClientRect().top - 29 + window.pageYOffset + 'px';
67412
- tool.style.left = col.getBoundingClientRect().left - 1 + 'px';
67413
- }
67414
-
67415
67292
  let tools = this.builder.doc.querySelectorAll('.is-row-tool');
67416
67293
  tools.forEach(tool => {
67417
67294
  tool.style.display = '';
@@ -67420,6 +67297,10 @@ class Rte {
67420
67297
  tools.forEach(tool => {
67421
67298
  tool.style.opacity = '';
67422
67299
  });
67300
+ tools = this.builder.doc.querySelectorAll('.is-col-tool');
67301
+ tools.forEach(tool => {
67302
+ tool.style.display = '';
67303
+ });
67423
67304
 
67424
67305
  if (this.builder.onZoomEnd) {
67425
67306
  let val = this.rteZoomSlider.value;
@@ -72738,6 +72619,7 @@ class Resize {
72738
72619
  Array.from(col.parentNode.children).map(item => {
72739
72620
  if (item.classList.contains('is-row-tool')) return;
72740
72621
  if (item.classList.contains('is-rowadd-tool')) return;
72622
+ if (item.classList.contains('is-col-tool')) return;
72741
72623
  if (item === col) return;
72742
72624
  numOfCols++;
72743
72625
  });
@@ -72750,7 +72632,8 @@ class Resize {
72750
72632
  let otherWidth = 0;
72751
72633
  Array.from(col.parentNode.children).map(item => {
72752
72634
  if (item.classList.contains('is-row-tool')) return;
72753
- if (item.classList.contains('is-rowadd-tool')) return; // if(this.opts.filterSibling) if(item.classList.contains(this.opts.filterSibling)) return;
72635
+ if (item.classList.contains('is-rowadd-tool')) return;
72636
+ if (item.classList.contains('is-col-tool')) return; // if(this.opts.filterSibling) if(item.classList.contains(this.opts.filterSibling)) return;
72754
72637
 
72755
72638
  if (item === col) return;
72756
72639
  otherWidth += item.offsetWidth;
@@ -72766,7 +72649,8 @@ class Resize {
72766
72649
  // Or make others auto
72767
72650
  Array.from(col.parentNode.children).map(item => {
72768
72651
  if (item.classList.contains('is-row-tool')) return;
72769
- if (item.classList.contains('is-rowadd-tool')) return; // if(this.opts.filterSibling) if(item.classList.contains(this.opts.filterSibling)) return;
72652
+ if (item.classList.contains('is-rowadd-tool')) return;
72653
+ if (item.classList.contains('is-col-tool')) return; // if(this.opts.filterSibling) if(item.classList.contains(this.opts.filterSibling)) return;
72770
72654
 
72771
72655
  if (item === col) return; // // item.style.width = '100%';
72772
72656
  // if(!item.getAttribute('data-module')) item.style.width = '100%';
@@ -72796,7 +72680,8 @@ class Resize {
72796
72680
  // New: if other cols has no width, set to 100%
72797
72681
  Array.from(col.parentNode.children).map(item => {
72798
72682
  if (item.classList.contains('is-row-tool')) return;
72799
- if (item.classList.contains('is-rowadd-tool')) return; // if(this.opts.filterSibling) if(item.classList.contains(this.opts.filterSibling)) return;
72683
+ if (item.classList.contains('is-rowadd-tool')) return;
72684
+ if (item.classList.contains('is-col-tool')) return; // if(this.opts.filterSibling) if(item.classList.contains(this.opts.filterSibling)) return;
72800
72685
 
72801
72686
  if (item === col) return;
72802
72687
 
@@ -72820,6 +72705,7 @@ class Resize {
72820
72705
  Array.from(col.parentNode.children).map(item => {
72821
72706
  if (item.classList.contains('is-row-tool')) return;
72822
72707
  if (item.classList.contains('is-rowadd-tool')) return;
72708
+ if (item.classList.contains('is-col-tool')) return;
72823
72709
  if (item === col) return;
72824
72710
  numOfCols++;
72825
72711
  });
@@ -72833,7 +72719,8 @@ class Resize {
72833
72719
  let otherWidth = 0;
72834
72720
  Array.from(col.parentNode.children).map(item => {
72835
72721
  if (item.classList.contains('is-row-tool')) return;
72836
- if (item.classList.contains('is-rowadd-tool')) return; // if(this.opts.filterSibling) if(item.classList.contains(this.opts.filterSibling)) return;
72722
+ if (item.classList.contains('is-rowadd-tool')) return;
72723
+ if (item.classList.contains('is-col-tool')) return; // if(this.opts.filterSibling) if(item.classList.contains(this.opts.filterSibling)) return;
72837
72724
 
72838
72725
  if (item.classList.contains('row-tool')) return;
72839
72726
  if (item === col) return;
@@ -72850,7 +72737,8 @@ class Resize {
72850
72737
  // Or make others auto
72851
72738
  Array.from(col.parentNode.children).map(item => {
72852
72739
  if (item.classList.contains('is-row-tool')) return;
72853
- if (item.classList.contains('is-rowadd-tool')) return; // if(this.opts.filterSibling) if(item.classList.contains(this.opts.filterSibling)) return;
72740
+ if (item.classList.contains('is-rowadd-tool')) return;
72741
+ if (item.classList.contains('is-col-tool')) return; // if(this.opts.filterSibling) if(item.classList.contains(this.opts.filterSibling)) return;
72854
72742
 
72855
72743
  if (item === col) return; // // item.style.width = '100%';
72856
72744
  // if(!item.getAttribute('data-module')) item.style.width = '100%';
@@ -72880,7 +72768,8 @@ class Resize {
72880
72768
  let activeColumnWidth = 0;
72881
72769
  Array.from(col.parentNode.children).map(item => {
72882
72770
  if (item.classList.contains('is-row-tool')) return;
72883
- if (item.classList.contains('is-rowadd-tool')) return; // if(this.opts.filterSibling) if(item.classList.contains(this.opts.filterSibling)) return;
72771
+ if (item.classList.contains('is-rowadd-tool')) return;
72772
+ if (item.classList.contains('is-col-tool')) return; // if(this.opts.filterSibling) if(item.classList.contains(this.opts.filterSibling)) return;
72884
72773
  // // Refresh Module
72885
72774
  // if(item.getAttribute('data-module')) {
72886
72775
  // this.builder.util.refreshModuleLayout(item);
@@ -72903,6 +72792,7 @@ class Resize {
72903
72792
  Array.from(col.parentNode.children).map(item => {
72904
72793
  if (item.classList.contains('is-row-tool')) return;
72905
72794
  if (item.classList.contains('is-rowadd-tool')) return;
72795
+ if (item.classList.contains('is-col-tool')) return;
72906
72796
 
72907
72797
  if (item.getAttribute('data-module')) {
72908
72798
  let moduleWidth = item.offsetWidth / row.offsetWidth * 100;
@@ -72918,7 +72808,8 @@ class Resize {
72918
72808
  col.style.height = '';
72919
72809
  Array.from(col.parentNode.children).map(item => {
72920
72810
  if (item.classList.contains('is-row-tool')) return;
72921
- if (item.classList.contains('is-rowadd-tool')) return; // if(this.opts.filterSibling) if(item.classList.contains(this.opts.filterSibling)) return;
72811
+ if (item.classList.contains('is-rowadd-tool')) return;
72812
+ if (item.classList.contains('is-col-tool')) return; // if(this.opts.filterSibling) if(item.classList.contains(this.opts.filterSibling)) return;
72922
72813
 
72923
72814
  if (item === col) return;
72924
72815
  item.style.height = '';
@@ -73529,6 +73420,8 @@ class ContentStuff {
73529
73420
  .row-active .is-row-tool {
73530
73421
  display:flex;
73531
73422
  }
73423
+
73424
+
73532
73425
  .row-outline .is-rowadd-tool,
73533
73426
  .row-active .is-rowadd-tool {
73534
73427
  display:block;
@@ -73599,7 +73492,78 @@ class ContentStuff {
73599
73492
  outline:none;
73600
73493
  }
73601
73494
 
73495
+ /* is-col-tool */
73602
73496
 
73497
+ .row-active .is-col-tool {
73498
+ display: flex;
73499
+ }
73500
+ .is-builder[rowoutline] .row-active .is-col-tool {
73501
+ display: none;
73502
+ }
73503
+ .is-builder[hidecolumntool] .row-active .is-col-tool {
73504
+ display: none;
73505
+ }
73506
+
73507
+
73508
+ .is-tool.is-col-tool {
73509
+ flex-direction: row;
73510
+ margin-top: 0px;
73511
+ margin-left: -1px;
73512
+ }
73513
+ .is-tool.is-col-tool button {
73514
+ width: 25px;
73515
+ height: 25px;
73516
+ display: flex;
73517
+ justify-content: center;
73518
+ align-items: center;
73519
+ }
73520
+ .is-tool.is-col-tool .cell-add {
73521
+ background: #0fcc52;
73522
+ }
73523
+ .is-tool.is-col-tool .cell-more {
73524
+ background: rgba(216, 200, 6, 0.9);
73525
+ }
73526
+ .is-tool.is-col-tool .cell-remove {
73527
+ background: rgba(255, 85, 4, 0.9);
73528
+ }
73529
+ .is-tool.is-col-tool svg {
73530
+ width: 23px;
73531
+ height: 23px;
73532
+ fill: #fff;
73533
+ }
73534
+ .is-tool.is-col-tool .cell-more svg {
73535
+ width: 14px;
73536
+ height: 14px;
73537
+ }
73538
+
73539
+
73540
+ .is-builder[gray] .is-tool.is-col-tool {
73541
+ background: rgba(243, 243, 243, 0.9);
73542
+ flex-direction: row;
73543
+ margin-top: -2px;
73544
+ }
73545
+ .is-builder[gray] .is-tool.is-col-tool button {
73546
+ width: 27px;
73547
+ height: 27px;
73548
+ }
73549
+ .is-builder[gray] .is-tool.is-col-tool .cell-add {
73550
+ background: transparent;
73551
+ }
73552
+ .is-builder[gray] .is-tool.is-col-tool .cell-more {
73553
+ background: transparent;
73554
+ }
73555
+ .is-builder[gray] .is-tool.is-col-tool .cell-remove {
73556
+ background: transparent;
73557
+ }
73558
+ .is-builder[gray] .is-tool.is-col-tool svg {
73559
+ width: 18px;
73560
+ height: 18px;
73561
+ fill: #000;
73562
+ }
73563
+ .is-builder[gray] .is-tool.is-col-tool .cell-more svg {
73564
+ width: 12px;
73565
+ height: 12px;
73566
+ }
73603
73567
 
73604
73568
 
73605
73569
  .is-builder[gridoutline] > div > div {
@@ -73876,7 +73840,8 @@ class ContentStuff {
73876
73840
  display: initial !important;
73877
73841
  }
73878
73842
  .is-section-tool svg,
73879
- .is-row-tool svg {
73843
+ .is-row-tool svg,
73844
+ .is-col-tool svg {
73880
73845
  display: initial !important;
73881
73846
  }
73882
73847
 
@@ -74824,7 +74789,6 @@ class ContentBuilder {
74824
74789
  var ret = oldget.apply(this, arguments);
74825
74790
 
74826
74791
  if (this.activeCol) {
74827
- // this.colTool.refreshColumnTool(this.activeCol);
74828
74792
  // Quick reposition column tool
74829
74793
  this.util.repositionColumnTool();
74830
74794
  }
@@ -75128,6 +75092,101 @@ class ContentBuilder {
75128
75092
  */
75129
75093
 
75130
75094
  }
75095
+ /*
75096
+ If latest npm is used, while local contentbuilder.css is still using the old version,
75097
+ then add the newest css here, so the newest script from npm will work fine.
75098
+ backwardCompatible() is called by rowtool.js
75099
+ */
75100
+
75101
+
75102
+ backwardCompatible() {
75103
+ let css = `
75104
+ .row-active .is-col-tool {
75105
+ display: flex;
75106
+ }
75107
+ .is-builder[rowoutline] .row-active .is-col-tool {
75108
+ display: none;
75109
+ }
75110
+ .is-builder[hidecolumntool] .row-active .is-col-tool {
75111
+ display: none;
75112
+ }
75113
+
75114
+ .is-tool.is-col-tool {
75115
+ flex-direction: row;
75116
+ margin-top: 0px;
75117
+ margin-left: -1px;
75118
+ }
75119
+ .is-tool.is-col-tool button {
75120
+ width: 25px;
75121
+ height: 25px;
75122
+ display: flex;
75123
+ justify-content: center;
75124
+ align-items: center;
75125
+ }
75126
+ .is-tool.is-col-tool .cell-add {
75127
+ background: #0fcc52;
75128
+ }
75129
+ .is-tool.is-col-tool .cell-more {
75130
+ background: rgba(216, 200, 6, 0.9);
75131
+ }
75132
+ .is-tool.is-col-tool .cell-remove {
75133
+ background: rgba(255, 85, 4, 0.9);
75134
+ }
75135
+ .is-tool.is-col-tool svg {
75136
+ width: 23px;
75137
+ height: 23px;
75138
+ fill: #fff;
75139
+ }
75140
+ .is-tool.is-col-tool .cell-more svg {
75141
+ width: 14px;
75142
+ height: 14px;
75143
+ }
75144
+
75145
+
75146
+ .is-builder[gray] .is-tool.is-col-tool {
75147
+ background: rgba(243, 243, 243, 0.9);
75148
+ flex-direction: row;
75149
+ top:-3px;
75150
+ margin-top: 0px;
75151
+ margin-left: -1px;
75152
+ }
75153
+ .is-builder[gray] .is-tool.is-col-tool button {
75154
+ width: 27px;
75155
+ height: 27px;
75156
+ }
75157
+ .is-builder[gray] .is-tool.is-col-tool .cell-add {
75158
+ background: transparent;
75159
+ }
75160
+ .is-builder[gray] .is-tool.is-col-tool .cell-more {
75161
+ background: transparent;
75162
+ }
75163
+ .is-builder[gray] .is-tool.is-col-tool .cell-remove {
75164
+ background: transparent;
75165
+ }
75166
+ .is-builder[gray] .is-tool.is-col-tool svg {
75167
+ width: 18px;
75168
+ height: 18px;
75169
+ fill: #000;
75170
+ }
75171
+ .is-builder[gray] .is-tool.is-col-tool .cell-more svg {
75172
+ width: 12px;
75173
+ height: 12px;
75174
+ }
75175
+
75176
+
75177
+ .is-col-tool svg {
75178
+ display: initial !important;
75179
+ }
75180
+ `;
75181
+
75182
+ if (!this.builderStuff.querySelector('style[data-rel="css-new"]')) {
75183
+ this.builderStuff.insertAdjacentHTML('afterbegin', `
75184
+ <style data-rel="css-new">
75185
+ ${css}
75186
+ </style>
75187
+ `);
75188
+ }
75189
+ }
75131
75190
 
75132
75191
  setZoomOnControl(area) {
75133
75192
  const rowtools = area.querySelectorAll('.is-row-tool');
@@ -75135,6 +75194,12 @@ class ContentBuilder {
75135
75194
  rowtool.style.transform = `scale(${1 / this.opts.zoom})`;
75136
75195
  rowtool.style.transformOrigin = 'top';
75137
75196
  });
75197
+ const coltools = area.querySelectorAll('.is-col-tool');
75198
+ coltools.forEach(coltool => {
75199
+ coltool.style.transform = `scale(${1 / this.opts.zoom})`;
75200
+ coltool.style.transformOrigin = 'top left';
75201
+ coltool.style.marginTop = `${-(27 / this.opts.zoom)}px`;
75202
+ });
75138
75203
  const rowaddtools = area.querySelectorAll('.is-rowadd-tool button');
75139
75204
  rowaddtools.forEach(rowaddtool => {
75140
75205
  rowaddtool.style.transform = `scale(${1 / this.opts.zoom})`; // rowtool.style.transformOrigin = 'top';
@@ -75239,7 +75304,7 @@ class ContentBuilder {
75239
75304
 
75240
75305
  const cols = this.dom.elementChildren(row);
75241
75306
  cols.forEach(col => {
75242
- if (this.dom.hasClass(col, 'is-row-tool') || this.dom.hasClass(col, 'is-rowadd-tool')) return; // Return if not a column
75307
+ if (this.dom.hasClass(col, 'is-row-tool') || this.dom.hasClass(col, 'is-col-tool') || this.dom.hasClass(col, 'is-rowadd-tool')) return; // Return if not a column
75243
75308
  // For backward compatibility, replace:
75244
75309
  // - data-mode="readonly" with data-noedit
75245
75310
  // - data-mode="readonly-protected" with data-protected
@@ -75373,19 +75438,9 @@ class ContentBuilder {
75373
75438
  onStart: () => {
75374
75439
  this.uo.saveForUndo(); // Even if cancelled, saveForUndo will make sure not to save if there is no change
75375
75440
 
75376
- this.colTool.hideColumnTool();
75377
75441
  this.elmTool.hide();
75378
75442
  },
75379
75443
  onEnd: () => {
75380
- if (!this.opts.emailMode) {
75381
- if (this.dom.hasClass(this.activeCol.parentNode, 'row-outline')) {
75382
- //if not row selection, but col selection
75383
- //if(this.activeCol.parentNode.classList.contains('row-outline')) { //if not row selection, but col selection
75384
- this.colTool.refreshColumnTool(this.activeCol);
75385
- this.colTool.showColumnTool(this.activeCol);
75386
- }
75387
- }
75388
-
75389
75444
  this.util.checkEmpty(); // for multiple instances check
75390
75445
  },
75391
75446
  onAdd: evt => {
@@ -75946,10 +76001,6 @@ class ContentBuilder {
75946
76001
 
75947
76002
  imageLoaded(obj) {
75948
76003
  obj.removeAttribute('onload');
75949
-
75950
- if (this.activeCol) {
75951
- this.colTool.refreshColumnTool(this.activeCol);
75952
- }
75953
76004
  } // Module related
75954
76005
 
75955
76006
 
@@ -76618,6 +76669,7 @@ class ContentBuilder {
76618
76669
  }
76619
76670
 
76620
76671
  setUIColorRefresh() {
76672
+ // All related with iframe style
76621
76673
  const util = this.util;
76622
76674
 
76623
76675
  if (!this.rte || !this.element) {
@@ -76748,7 +76800,11 @@ class ContentBuilder {
76748
76800
  }
76749
76801
 
76750
76802
  handleCellClick(col, e) {
76751
- if (this.cleanEditing) col.parentNode.querySelector('.is-row-tool').style.display = '';
76803
+ if (this.cleanEditing) {
76804
+ col.parentNode.querySelector('.is-row-tool').style.display = '';
76805
+ col.parentNode.querySelector('.is-col-tool').style.display = '';
76806
+ }
76807
+
76752
76808
  this.lightboxOpen(col);
76753
76809
  const util = this.util;
76754
76810
  util.clearActiveCell();
@@ -77271,6 +77327,7 @@ class ContentBuilder {
77271
77327
  if (this.cleanEditing) {
77272
77328
  this.colTool.columnTool.classList.remove('active');
77273
77329
  col.parentNode.querySelector('.is-row-tool').style.display = 'none';
77330
+ col.parentNode.querySelector('.is-col-tool').style.display = 'none';
77274
77331
  }
77275
77332
  }
77276
77333