geno/wp-content/plugins/elementor/assets/js/styleguide.min.js

2 lines
46 KiB
JavaScript
Raw Permalink Normal View History

2024-02-01 17:24:18 +05:30
/*! elementor - v3.18.0 - 20-12-2023 */
(()=>{var t={85422:(t,r,o)=>{"use strict";var i=o(38003).__,a=o(73203)(o(93231)),l=o(12406);t.exports=Marionette.Behavior.extend({tagView:null,listenerAttached:!1,initialize:function initialize(){this.listenerAttached||(this.listenTo(this.view.options.container.settings,"change:external:__dynamic__",this.onAfterExternalChange),this.listenerAttached=!0)},shouldRenderTools:function shouldRenderTools(){if(this.getOption("dynamicSettings").default)return!1;var t=elementor.helpers.hasPro()&&!elementor.helpers.hasProAndNotConnected(),r=this.getOption("tags").length>0;return!t||r},renderTools:function renderTools(){var t=this;if(this.shouldRenderTools()){var r=jQuery(Marionette.Renderer.render("#tmpl-elementor-control-dynamic-switcher"));r.on("click",(function(r){return t.onDynamicSwitcherClick(r)})),this.$el.find(".elementor-control-dynamic-switcher-wrapper").append(r),this.ui.dynamicSwitcher=r,"color"===this.view.model.get("type")&&(this.view.colorPicker?this.moveDynamicSwitcherToColorPicker():setTimeout((function(){return t.moveDynamicSwitcherToColorPicker()}))),this.ui.dynamicSwitcher.tipsy({title:function title(){return this.getAttribute("data-tooltip")},gravity:"s"})}},moveDynamicSwitcherToColorPicker:function moveDynamicSwitcherToColorPicker(){var t=this.view.colorPicker.$pickerToolsContainer;this.ui.dynamicSwitcher.removeClass("elementor-control-unit-1").addClass("e-control-tool");var r=t.find(".elementor-control-element-color-picker");r.length?this.ui.dynamicSwitcher.insertBefore(r):t.append(this.ui.dynamicSwitcher)},toggleDynamicClass:function toggleDynamicClass(){this.$el.toggleClass("elementor-control-dynamic-value",this.isDynamicMode())},isDynamicMode:function isDynamicMode(){var t=this.view.container.settings.get("__dynamic__");return!(!t||!t[this.view.model.get("name")])},createTagsList:function createTagsList(){var t=_.groupBy(this.getOption("tags"),"group"),r=elementor.dynamicTags.getConfig("groups"),o=this.ui.tagsList=jQuery("<div>",{class:"elementor-tags-list"}),i=jQuery("<div>",{class:"elementor-tags-list__inner"});if(o.append(i),jQuery.each(r,(function(r){var o=t[r];if(o){var a=jQuery("<div>",{class:"elementor-tags-list__group-title"}).text(this.title);i.append(a),o.forEach((function(t){var r=jQuery("<div>",{class:"elementor-tags-list__item"});r.text(t.title).attr("data-tag-name",t.name),i.append(r)}))}})),!elementor.helpers.hasPro()&&Object.keys(t).length){var a=Marionette.Renderer.render("#tmpl-elementor-dynamic-tags-promo",{promotionUrl:elementor.config.dynamicPromotionURL.replace("%s",this.view.model.get("name"))});i.append(a)}i.on("click",".elementor-tags-list__item",this.onTagsListItemClick.bind(this)),elementorCommon.elements.$body.append(o)},getTagsList:function getTagsList(){return this.ui.tagsList||this.createTagsList(),this.ui.tagsList},toggleTagsList:function toggleTagsList(){var t=this.getTagsList();if(t.is(":visible"))t.hide();else{var r=elementorCommon.config.isRTL?"left":"right";t.show().position({my:"".concat(r," top"),at:"".concat(r," bottom+5"),of:this.ui.dynamicSwitcher})}},setTagView:function setTagView(t,r,o){this.tagView&&this.tagView.destroy();var i=this.tagView=new l({id:t,name:r,settings:o,controlName:this.view.model.get("name"),dynamicSettings:this.getOption("dynamicSettings")}),a=this.view.options.container,u=a.controls[i.options.controlName].label;i.options.container=new elementorModules.editor.Container({type:"dynamic",id:t,model:i.model,settings:i.model,view:i,parent:a,label:a.label+" "+u,controls:i.model.options.controls,renderer:a}),i.render(),this.$el.find(".elementor-control-tag-area").after(i.el),this.listenTo(i,"remove",this.onTagViewRemove.bind(this))},setDefaultTagView:function setDefaultTagView(){var t=elementor.dynamicTags.tagTextToTagData(this.getDynamicValue());this.setTagView(t.id,t.name,t.settings)},tagViewToTagText:function tagViewToTagText(){var t=this.tagView;return elementor.dynamicTags.tagDataToTagText(t.getOption("id"),t.getOption("name"),t.model)},getDynamicValue:function getDynamicValue(){return this.view.container.dynamic.get(this.view.model.get("name")