Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Component Navigator window

givanz6b5525016a0b
diff --git a/public/js/vvvebjs/builder.js b/public/js/vvvebjs/builder.js
index 37cff68..1ff25e9 100755
--- a/public/js/vvvebjs/builder.js
+++ b/public/js/vvvebjs/builder.js
@@ -325,8 +325,8 @@ Vvveb.Components = {
var sectionName = this.dataset.section;
componentsPanelSections[sectionName] = $(this);
$('.section[data-section!="default"]', this).remove();
- $('label[for!="header_default"]', this).remove();
- $('input[id!="header_default"]', this).remove();
+ $('label[data-header!="default"] + input', this).remove();
+ $('label[data-header!="default"]', this).remove();
});
var section = componentsPanelSections[defaultSection].find('.section[data-section="default"]');
@@ -973,22 +973,28 @@ Vvveb.Builder = {
},
adjustListsHeight: function () {
- let lists = $(".drag-elements-sidepane > div:not(.block-preview)");
- let properties = $(".component-properties > .tab-content");
+ let left = $("#left-panel .drag-elements-sidepane > div:not(.block-preview), #left-panel .component-properties > .tab-content");
+ let right = $("#right-panel .drag-elements-sidepane > div:not(.block-preview), #right-panel .component-properties > .tab-content");
let wHeight = $(window).height();
-
let maxOffset = 0;
function adjust(elements) {
elements.each(function (i,e) {
e.style.height = "";
- maxOffset = Math.max(0, e.getBoundingClientRect()["top"]);
- e.style.height = (wHeight - maxOffset) + "px";
+ let offset = Math.floor(e.getBoundingClientRect()["top"]);
+ if (offset >= wHeight) return;
+ maxOffset = Math.max(maxOffset, offset);
+ let height = wHeight - maxOffset;
+ if (!offset) {
+ height += parseInt(e.dataset.offset ?? 0);
+ }
+ e.style.height = height + "px";
});
}
- adjust(lists);
- adjust(properties);
+ adjust(left);
+ maxOffset = 0;
+ adjust(right);
},
@@ -1172,7 +1178,7 @@ Vvveb.Builder = {
{
$(node).parent().before(node);
}
-
+
Vvveb.Builder.selectNode(node);
newParent = node.parentNode;
@@ -1391,7 +1397,7 @@ Vvveb.Builder = {
br: true,
wbr: true
};
-
+
try {
if ((offset.top < (event.originalEvent.pageY - halfHeight)) || (offset.left < (x - halfWidth)))
{
@@ -1505,6 +1511,8 @@ Vvveb.Builder = {
node = self.dragElement.get(0);
self.selectNode(node);
+ Vvveb.TreeList.loadComponents();
+ Vvveb.TreeList.selectComponent(node);
self.loadNodeComponent(node);
//if component properties is loaded in left panel tab instead of right panel show tab
if ($(".component-properties-tab").is(":visible"))//if properites tab is enabled/visible
@@ -1574,6 +1582,7 @@ Vvveb.Builder = {
$('.component-properties-tab a').show().tab('show');
self.selectNode(event.target);
+ Vvveb.TreeList.selectComponent(event.target);
self.loadNodeComponent(event.target);
if (Vvveb.component.resizable) {
@@ -1597,6 +1606,7 @@ Vvveb.Builder = {
$("#drag-btn").on("mousedown", function(event) {
//self.dragElement = self.selectedEl.attr("style",Vvveb.dragElementStyle);
+ if (event.which == 1) {//left click
self.isDragging = true;
$("#section-actions, #highlight-name, #select-box").hide();
@@ -1606,7 +1616,7 @@ Vvveb.Builder = {
} else {
self.selectedEl.css("position", "" ).css("top", "" ).css("left", "" );
self.selectedEl.addClass("is-dragged");
- self.dragElement = $(Vvveb.dragHtml);
+ self.dragElement = $(Vvveb.dragHtml);
}
node = self.selectedEl.get(0);
@@ -1619,9 +1629,11 @@ Vvveb.Builder = {
//self.selectNode(false);
event.preventDefault();
return false;
+ }
});
$(".resize > div").on("mousedown", function(event) {
+ if (event.which == 1) {//left click
$("#section-actions, #highlight-name, #highlight-box").hide();
self.isResize = true;
@@ -1631,6 +1643,7 @@ Vvveb.Builder = {
event.preventDefault();
return false;
+ }
});
$("#down-btn").on("click", function(event) {
@@ -1666,6 +1679,7 @@ Vvveb.Builder = {
self.selectNode(node);
self.loadNodeComponent(node);
+ Vvveb.TreeList.selectComponent(node);
event.preventDefault();
return false;
@@ -1798,6 +1812,8 @@ Vvveb.Builder = {
node = node.get(0);
self.selectNode(node);
self.loadNodeComponent(node);
+ Vvveb.TreeList.loadComponents();
+ Vvveb.TreeList.selectComponent(node);
Vvveb.Undo.addMutation({type: 'childList',
target: node.parentNode,
@@ -1839,7 +1855,7 @@ Vvveb.Builder = {
self.isDragging = false;
$("body").on("mousedown touchstart", ".drag-elements-sidepane ul > li > ol > li[data-drag-type]", function(event) {
-
+ if (event.which == 1) {//left click
$this = $(this);
$("#component-clone").remove();
@@ -1883,6 +1899,7 @@ Vvveb.Builder = {
event.preventDefault();
return false;
+ }
});
$('body').on('mouseup dragend touchend', function(event) {
@@ -2475,6 +2492,14 @@ Vvveb.Gui = {
Vvveb.Builder.adjustListsHeight();
},
+
+ toggleTreeList: function () {
+ let treeList = document.getElementById("tree-list");
+ treeList.classList.toggle("d-none");
+ if (!treeList.offsetParent) {
+ document.getElementById("toggle-tree-list").classList.remove("active");
+ }
+ },
}
Vvveb.StyleManager = {
@@ -2724,9 +2749,9 @@ Vvveb.ContentManager = {
},
};
-function getNodeTree (node, parent, allowedComponents) {
+function getNodeTree (node, parent, allowedComponents, idToNode = {}) {
- function getNodeTreeTraverse (node, parent) {
+ function getNodeTreeTraverse (node, parent, id = '') {
if (node.hasChildNodes()) {
for (var j = 0; j < node.childNodes.length; j++) {
@@ -2753,16 +2778,18 @@ function getNodeTree (node, parent, allowedComponents) {
image: matchChild.image,
type: matchChild.type,
node: child,
+ id: id + '-' + j,
children: []
};
element.children = [];
parent.push(element);
+ idToNode[id + '-' + j] = child;
- element = getNodeTreeTraverse(child, element.children);
+ element = getNodeTreeTraverse(child, element.children, id + '-' + j);
} else
{
- element = getNodeTreeTraverse(child, parent);
+ element = getNodeTreeTraverse(child, parent, id + '-' + j);
}
}
}
@@ -2770,7 +2797,7 @@ function getNodeTree (node, parent, allowedComponents) {
return false;
}
- getNodeTreeTraverse(node, parent);
+ getNodeTreeTraverse(node, parent, '1');
}
function drawComponentsTree(tree) {
@@ -2784,7 +2811,10 @@ function drawComponentsTree(tree) {
for (i in tree)
{
var node = tree[i];
- var id = prefix + '-' + j + '-' + i;
+ var id = node.id;
+ if (!id) {
+ id = prefix + '-' + j + '-' + i;
+ }
if (tree[i].children.length > 0)
{
@@ -2828,13 +2858,7 @@ Vvveb.SectionList = {
$(this.selector).on("click", "> div .controls", function (e) {
var node = $(e.currentTarget.parentNode).data("node");
if (node) {
-
- delay(
- () => Vvveb.Builder.frameHtml.animate({
- scrollTop: $(node).offset().top - ($(node).height() / 2)
- }, 500),
- 300);
-
+ node.scrollIntoView({behavior: "smooth", block: "center", inline: "center"});
//node.click();
Vvveb.Builder.selectNode(node);
Vvveb.Builder.loadNodeComponent(node);
@@ -2847,26 +2871,13 @@ Vvveb.SectionList = {
$(this.selector).on("click", "li[data-component] label ", function (e) {
node = $(e.currentTarget.parentNode).data("node");
-
- delay(
- () => Vvveb.Builder.frameHtml.animate({
- scrollTop: $(node).offset().top - ($(node).height() / 2)
- }, 1000),
- 300);
-
+ if (node) {
+ node.scrollIntoView({behavior: "smooth", block: "center", inline: "center"});
node.click();
+ }
}).on("mouseenter", "li[data-component] label", function (e) {
node = $($(e.currentTarget.parentNode).data("node"));
node.css("outline","1px dashed blue");
- /*
- delay(
- () => Vvveb.Builder.frameHtml.animate({
- scrollTop: $(node).offset().top - ($(node).height() / 2)
- }, 500),
- 1000);
-
- $(node).trigger("mousemove");
- */
}).on("mouseleave", "li[data-component] label", function (e){
node = $($(e.currentTarget.parentNode).data("node"));
node.css("outline","");
@@ -2946,11 +2957,16 @@ Vvveb.SectionList = {
}
}
+ node[0].scrollIntoView({behavior: "smooth", block: "center", inline: "center"});
+ node.click();
+ /*
Vvveb.Builder.frameHtml.animate({
scrollTop: $(node).offset().top
}, 1000);
delay(() => node.click(), 1000);
+ */
+
node = node.get(0);
Vvveb.Undo.addMutation({type: 'childList',
@@ -2960,6 +2976,9 @@ Vvveb.SectionList = {
self.loadSections();
+ Vvveb.TreeList.loadComponents();
+ Vvveb.TreeList.selectComponent(node);
+
e.preventDefault();
});
@@ -3010,7 +3029,7 @@ Vvveb.SectionList = {
section.data("node", data.node);
$(this.selector).append(section);
- this.loadComponents(section, data.node, this.allowedComponents);
+ //this.loadComponents(section, data.node, this.allowedComponents);
},
loadSections: function() {
@@ -3075,6 +3094,133 @@ Vvveb.SectionList = {
},
}
+Vvveb.TreeList = {
+ selector: '#tree-list',
+
+ tree: [],
+
+ idToNode : {},
+
+ init: function() {
+ // header move
+ let div = document.querySelector(this.selector);
+ let header = document.querySelector(this.selector + " .header");
+ let isDown = false;
+ let offset = [0,0];
+
+ header.addEventListener('mousedown', function(e) {
+ if (e.which == 1) {//left click
+ isDown = true;
+ offset = [
+ div.offsetLeft - e.clientX,
+ div.offsetTop - e.clientY
+ ];
+ }
+ }, true);
+
+ document.addEventListener('mouseup', function() {
+ isDown = false;
+ }, true);
+
+ document.addEventListener('mousemove', function(event) {
+ if (isDown) {
+ event.preventDefault();
+ div.style.left = (event.clientX + offset[0]) + 'px';
+ div.style.top = (event.clientY + offset[1]) + 'px';
+ }
+ }, true);
+
+
+ //components click
+ $(this.selector).on("click", "> div .controls", function (e) {
+ var node = $(e.currentTarget.parentNode).data("node");
+ if (node) {
+ node.scrollIntoView({behavior: "smooth", block: "center", inline: "center"});
+ //node.click();
+ Vvveb.Builder.selectNode(node);
+ Vvveb.Builder.loadNodeComponent(node);
+ }
+ }).on("dblclick", "> div", function (e) {
+ node = $(e.currentTarget).data("node");
+ //node.click();
+ Vvveb.Builder.selectNode(node);
+ Vvveb.Builder.loadNodeComponent(node);
+ });
+
+
+ $(this.selector).on("click", "li[data-component] label ", function (e) {
+ node = $(e.currentTarget.parentNode).data("node");
+ node.scrollIntoView({behavior: "smooth", block: "center", inline: "center"});
+ node.click();
+ }).on("mouseenter", "li[data-component] label", function (e) {
+ node = $($(e.currentTarget.parentNode).data("node"));
+ node.css("outline","1px dashed blue");
+ }).on("mouseleave", "li[data-component] label", function (e){
+ node = $($(e.currentTarget.parentNode).data("node"));
+ node.css("outline","");
+ if (node.attr("style") == "") node.removeAttr("style");
+ });
+
+ },
+
+ selectComponent: function(node) {
+ let id;
+ for (i in this.idToNode) {
+ if (node == this.idToNode[i]) {
+ id = i;
+ break;
+ }
+ }
+
+ if (id) {
+ let element = document.getElementById("id" + id);
+
+ $(this.selector + " .active").removeClass("active");
+ //collapse all
+ let checkboxes = document.querySelectorAll(this.selector + " input[type=checkbox]:checked");
+ for (var i = 0, len = checkboxes.length; i < len; i++) {
+ checkboxes[i].checked = false;
+ let label = checkboxes[i].labels[0];
+ if (label) {
+ label.classList.remove("active");
+ }
+ }
+
+ //expand parents
+ if (element) {
+ let parent = element;
+ let current = element;
+ while (parent = current.closest("li")) {
+ current = parent.parentNode;
+ let input = parent.querySelector("input");
+ if (input && input.hasAttribute("type") && input.type == "checkbox") {
+ input.checked = true;
+ }
+ }
+
+ element.checked = true;
+ element.labels[0].classList.add("active");
+ element.scrollIntoView({behavior: "smooth", block: "center", inline: "center"});
+ }
+ }
+
+ return false;
+ },
+
+ loadComponents: function() {
+ let list = $(this.selector + " .tree > ol");
+ //if navigator not visible don't load
+ if (list[0].offsetParent === null) return;
+
+ this.tree = [];
+ this.idToNode = {};
+ getNodeTree(window.FrameDocument.body, this.tree, {}, this.idToNode);
+
+ var html = drawComponentsTree(this.tree);
+ $(this.selector + " .tree > ol").replaceWith(html);
+ },
+}
+
Vvveb.FileManager = {
tree:false,
pages:{},
@@ -3120,25 +3266,13 @@ Vvveb.FileManager = {
$(this.tree).on("click", "li[data-component] label ", function (e) {
node = $(e.currentTarget.parentNode).data("node");
-
- delay(
- () => Vvveb.Builder.frameHtml.animate({
- scrollTop: $(node).offset().top - ($(node).height() / 2)
- }, 500),
- 500);
-
-
+ node.scrollIntoView({behavior: "smooth", block: "center", inline: "center"});
node.click();
}).on("mouseenter", "li[data-component] label", function (e) {
node = $(e.currentTarget.parentNode).data("node");
-
- delay(
- () => Vvveb.Builder.frameHtml.animate({
- scrollTop: $(node).offset().top - ($(node).height() / 2)
- }, 500),
- 1000);
+ node.scrollIntoView({behavior: "smooth", block: "center", inline: "center"});
$(node).trigger("mousemove");
@@ -3345,6 +3479,7 @@ Vvveb.FileManager = {
function () {
if (loadComponents) { Vvveb.FileManager.loadComponents(allowedComponents); }
Vvveb.SectionList.loadSections(allowedComponents);
+ Vvveb.TreeList.loadComponents();
Vvveb.StyleManager.init();
Vvveb.ChangeManager.setOriginalContent();
});
@@ -3367,12 +3502,7 @@ Vvveb.Breadcrumb = {
let node = $(this).data("node");
if (node) {
node.click();
-
- delay(
- () => Vvveb.Builder.frameHtml.animate({
- scrollTop: $(node).offset().top - ($(node).height() / 2)
- }, 500),
- 100);
+ node.scrollIntoView({behavior: "smooth", block: "center", inline: "center"});
}
$(window).triggerHandler("vvveb.Breadcrumb.click", node);
@@ -3388,12 +3518,6 @@ Vvveb.Breadcrumb = {
$(window).triggerHandler("vvveb.Breadcrumb.hover", node);
//node.css("outline","1px dashed blue");
/*
- delay(
- () => Vvveb.Builder.frameHtml.animate({
- scrollTop: $(node).offset().top - ($(node).height() / 2)
- }, 500),
- 1000);
-
$(node).trigger("mousemove");
*/
diff --git a/public/js/vvvebjs/components-bootstrap5.js b/public/js/vvvebjs/components-bootstrap5.js
index eb911da..514e762 100755
--- a/public/js/vvvebjs/components-bootstrap5.js
+++ b/public/js/vvvebjs/components-bootstrap5.js
@@ -726,7 +726,7 @@ Vvveb.Components.extend("_base", "html/tablebody", {
Vvveb.Components.extend("_base", "html/gridcolumn", {
name: "Grid Column",
- image: "icons/grid_row.svg",
+ image: "icons/grid_column.svg",
classesRegex: ["col-"],
classes: ["col"],
html: '<div class="col-sm-4"><h3>col-sm-4</h3></div>',
@@ -834,14 +834,181 @@ Vvveb.Components.extend("_base", "html/gridrow", {
return item.key.indexOf("column") === -1;
});
- //add remaining properties to generated column properties
- properties.push(this.properties[0]);
+ //add remaining properties to generated column properties, put first 2 align properties first
+ this.properties = this.properties.slice(0,4).concat(properties, this.properties.slice(4));
- this.properties = properties;
return node;
},
properties: [{
+ name: "Direction",
+ key: "direction",
+ htmlAttr: "class",
+ inline:false,
+ validValues: ["", "flex-row", "flex-row-reverse", "flex-column", "flex-column-reverse"],
+ inputtype: RadioButtonInput,
+ data: {
+ extraclass:"btn-group-sm btn-group-fullwidth",
+ options: [{
+ value: "",
+ icon:"la la-times",
+ //text: "None",
+ title: "Default",
+ checked:true,
+ }, {
+ value: "flex-row",
+ //text: "Left",
+ title: "Row - horizontal",
+ icon:"la la-arrow-right",
+ checked:false,
+ }, {
+ value: "flex-column",
+ //text: "Center",
+ title: "Column - vertical",
+ icon:"la la-arrow-down",
+ checked:false,
+ }, {
+ value: "flex-row-reverse",
+ //text: "Right",
+ title: "Row - reversed",
+ icon:"la la-arrow-left",
+ checked:false,
+ }, {
+ value: "flex-column-reverse",
+ //text: "Center",
+ title: "Column - reversed",
+ icon:"la la-arrow-up",
+ checked:false,
+ }],
+ },
+ },{
+ name: "Vertical align",
+ key: "vertical-align",
+ htmlAttr: "class",
+ inline:false,
+ validValues: ["", "align-items-start", "align-items-center", "align-items-end", "align-items-baseline", "align-items-stretch"],
+ inputtype: RadioButtonInput,
+ data: {
+ extraclass:"btn-group-sm btn-group-fullwidth",
+ options: [{
+ value: "",
+ icon:"la la-times",
+ //text: "None",
+ title: "None",
+ checked:true,
+ }, {
+ value: "align-items-start",
+ //text: "Left",
+ title: "Start",
+ icon:"la la-align-left",
+ checked:false,
+ }, {
+ value: "align-items-center",
+ //text: "Center",
+ title: "Center",
+ icon:"la la-align-center",
+ checked:false,
+ }, {
+ value: "align-items-end",
+ //text: "Right",
+ title: "End",
+ icon:"la la-align-right",
+ checked:false,
+ }, {
+ value: "align-items-baseline",
+ title: "Baseline",
+ icon:"la la-indent",
+ checked:false,
+ }, {
+ value: "align-items-stretch",
+ title: "Stretch",
+ icon:"la la-align-justify",
+ checked:false,
+ }],
+ },
+ },{
+ name: "Horizontal align",
+ key: "horizontal-align",
+ htmlAttr: "class",
+ inline:false,
+ validValues: ["", "justify-content-start", "justify-content-center", "justify-content-end", "justify-content-around", "justify-content-between", "justify-content-evenly"],
+ inputtype: RadioButtonInput,
+ data: {
+ extraclass:"btn-group-sm btn-group-fullwidth",
+ options: [{
+ value: "",
+ icon:"la la-times",
+ //text: "None",
+ title: "None",
+ checked:true,
+ }, {
+ value: "justify-content-start",
+ //text: "Left",
+ title: "Start",
+ icon:"la la-align-left",
+ checked:false,
+ }, {
+ value: "justify-content-center",
+ //text: "Center",
+ title: "Center",
+ icon:"la la-align-center",
+ checked:false,
+ }, {
+ value: "justify-content-end",
+ //text: "Right",
+ title: "End",
+ icon:"la la-align-right",
+ checked:false
+ }, {
+ value: "justify-content-around",
+ //text: "Left",
+ title: "Around",
+ icon:"la la-indent",
+ checked:false,
+ }, {
+ value: "justify-content-between",
+ //text: "Center",
+ title: "Between",
+ icon:"la la-outdent",
+ checked:false,
+ }, {
+ value: "justify-content-evenly",
+ //text: "Right",
+ title: "Evenly",
+ icon:"la la-align-justify",
+ checked:false,
+ }],
+ },
+ },{
+ name: "Wrap",
+ key: "wrap",
+ htmlAttr: "class",
+ inline:false,
+ validValues: ["", "flex-wrap", "flex-nowrap"],
+ inputtype: RadioButtonInput,
+ data: {
+ extraclass:"btn-group-sm btn-group-fullwidth",
+ options: [{
+ value: "",
+ icon:"la la-times",
+ //text: "None",
+ title: "None",
+ checked:true,
+ }, {
+ value: "flex-wrap",
+ //text: "Left",
+ title: "Wrap",
+ icon:"la la-undo",
+ checked:false,
+ }, {
+ value: "flex-nowrap",
+ //text: "Center",
+ title: "No wrap",
+ icon:"la la-arrow-right",
+ checked:false,
+ }],
+ },
+ },{
name: "Column",
key: "column1",
inputtype: GridInput
diff --git a/public/js/vvvebjs/components-common.js b/public/js/vvvebjs/components-common.js
index ebab093..456b6f4 100755
--- a/public/js/vvvebjs/components-common.js
+++ b/public/js/vvvebjs/components-common.js
@@ -883,7 +883,8 @@ Vvveb.Components.extend("_base", "_base", {
onChange: function(node, value) {
- $(node).css('background-image', 'url(' + value + ')');
+ Vvveb.StyleManager.setStyle($(node), "background-image", 'url(' + value + ')');
+ //$(node).css('background-image', 'url(' + value + ')');
return node;
}
diff --git a/public/js/vvvebjs/components-elements.js b/public/js/vvvebjs/components-elements.js
index 8e94ae3..0b04d5a 100755
--- a/public/js/vvvebjs/components-elements.js
+++ b/public/js/vvvebjs/components-elements.js
@@ -214,7 +214,7 @@ Vvveb.Components.extend("_base","elements/svg-icon", {
element.replaceWith(newElement);
return newElement;
},
- data: {
+ data: {
url: Vvveb.baseUrl + "../../resources/svg/icons/{value}/index.html",
clickElement:"li",
insertElement:"svg",
@@ -253,8 +253,8 @@ Vvveb.Components.extend("_base","elements/svg-icon", {
value: "olicons",
text: "Olicons"
}, {
- value: "open-iconic",
- text: "Open iconic"
+ value: "open-iconic",
+ text: "Open iconic"
}, {
value: "boxicons",
text: "Box icons"
@@ -307,8 +307,8 @@ Vvveb.Components.extend("_base","elements/svg-icon", {
value: "material-design",
text: "Material Design"
}]
- },
- }, {
+ },
+ }, {
name: "Width",
key: "width",
htmlAttr: "width",
@@ -351,8 +351,8 @@ Vvveb.Components.extend("_base","elements/svg-icon", {
//sort: base_sort++,
col:4,
inline:true,
- section: style_section,
- htmlAttr: "fill",
+ section: style_section,
+ htmlAttr: "fill",
inputtype: ColorInput,
},{
name: "Color",
@@ -360,8 +360,8 @@ Vvveb.Components.extend("_base","elements/svg-icon", {
//sort: base_sort++,
col:4,
inline:true,
- section: style_section,
- htmlAttr: "color",
+ section: style_section,
+ htmlAttr: "color",
inputtype: ColorInput,
},{
name: "Stroke",
@@ -369,7 +369,7 @@ Vvveb.Components.extend("_base","elements/svg-icon", {
//sort: base_sort++,
col:4,
inline:true,
- section: style_section,
+ section: style_section,
htmlAttr: "stroke",
inputtype: ColorInput,
}]
@@ -1073,12 +1073,17 @@ function carouselAfterDrop(node) {
function initSwiper(onlyNew = false) {
var list = document.querySelectorAll('.swiper' + (onlyNew ? ":not(.swiper-initialized)" : "") );
list.forEach(el => {
- //el.dataset
- let params = {};
+ let params = {
+ navigation: {
+ nextEl: ".swiper-button-next",
+ prevEl: ".swiper-button-prev",
+ },
+ pagination: {
+ el: ".swiper-pagination",
+ },
+ };
for (i in el.dataset) {
let param = el.dataset[i];
- console.log(i);
- console.log(param);
if (param[0] = '{') {
param = JSON.parse(param);
}
@@ -1431,7 +1436,10 @@ Vvveb.Components.add("elements/image-compare", {
nodes: [".counter"],
name: "Image Compare",
image: "icons/image-compare.svg",
- html: `<i class="font-icon la la-star"></i>`,
+ html: `<div class="c-compare" style="--value:50%;">
+ <img class="c-compare__left" src="img/color.jpg" alt="" />
+ <img class="c-compare__right" src="img/bw.jpg" alt="" />
+ </div>`,
properties: [
]
});
diff --git a/public/js/vvvebjs/components-html.js b/public/js/vvvebjs/components-html.js
index 0147760..ab3f89b 100755
--- a/public/js/vvvebjs/components-html.js
+++ b/public/js/vvvebjs/components-html.js
@@ -115,7 +115,7 @@ Vvveb.Components.extend("_base", "html/link", {
Vvveb.Components.extend("_base", "html/image", {
nodes: ["img"],
name: "Image",
- html: '<img src="' + Vvveb.baseUrl + 'icons/image.svg" class="mw-100 align-center">',
+ html: '<img src="' + Vvveb.baseUrl + 'icons/image.svg" width="300" class="mw-100 align-center">',
image: "icons/image.svg",
resizable:true,//show select box resize handlers
@@ -832,7 +832,7 @@ Vvveb.Components.extend("_base", "html/paragraph", {
html: '<p>Lorem ipsum</p>',
properties: [{
name: "Text align",
- key: "text-align",
+ key: "p-text-align",
htmlAttr: "class",
inline:false,
validValues: ["", "text-start", "text-center", "text-end"],
diff --git a/public/js/vvvebjs/icons/grid_column.svg b/public/js/vvvebjs/icons/grid_column.svg
new file mode 100644
index 0000000..0256878
--- /dev/null
+++ b/public/js/vvvebjs/icons/grid_column.svg
@@ -0,0 +1 @@
+<svg viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h256v256H0z"/><rect fill="none" height="97.872" rx="8" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="8" transform="rotate(90)" width="176" x="40" y="-173.872"/></svg>
\ No newline at end of file
diff --git a/public/js/vvvebjs/section.js b/public/js/vvvebjs/section.js
index 5057fe3..3d02507 100644
--- a/public/js/vvvebjs/section.js
+++ b/public/js/vvvebjs/section.js
@@ -177,7 +177,6 @@ let SectionOverlay = [
if (overlay.length) {
group.show();
- console.log(group);
return 'true';
} else {
group.hide();
@@ -251,7 +250,6 @@ function sectionSeparatorProperties(name, title) {
if (separator.length) {
group.show();
- console.log(group);
return 'true';
} else {
group.hide();
@@ -266,7 +264,6 @@ function sectionSeparatorProperties(name, title) {
child:`.separator.${name} > svg`,
inputtype: HtmlListSelectInput,
onChange:function(element, value, input, component) {
- console.log(element);
var newElement = $(value);
let attributes = element.prop("attributes");