File: /home/niched/writesideup.net/wp-content/plugins/codevz-plus/elementor/elementor.js
/**
*
* Elementor controls
*
* Plugin: Codevz Plus
* Copyright: http://codevz.com/
*
*/
;(function ( $, window, document ) {
'use strict';
jQuery(window).on( 'elementor:init', function() {
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var StyleKit = elementor.modules.controls.BaseData.extend( {
onReady: function() {
setTimeout(function() {
// Trigger stylekit button
}, 1000 );
},
saveValue: function() {
var obj = {};
this.ui.input.each(function(e) {
var en = $( this );
obj[ en.data( 'setting' ) ] = en.val();
});
this.setValue( obj );
},
onBeforeDestroy: function() {
this.saveValue();
},
applySavedValue: function applySavedValue() {
var values = this.getControlValue(),
$inputs = this.$('[data-setting]'),
self = this;
_.each(values, function (value, key) {
var $input = $inputs.filter(function () {
return key === this.dataset.setting;
});
self.setInputValue($input, value);
});
},
getControlValue: function getControlValue(key) {
var values = this.elementSettingsModel.get(this.model.get('name'));
if (!jQuery.isPlainObject(values)) {
return {};
}
if (key) {
var value = values[key];
if (undefined === value) {
value = '';
}
return value;
}
return elementor.helpers.cloneObject( values );
},
setValue: function setValue( key, value ) {
var values = this.getControlValue();
if ( 'object' === ( typeof key === 'undefined' ? 'undefined' : _typeof( key ) ) ) {
_.each(key, function ( internalValue, internalKey ) {
values[internalKey] = internalValue;
});
} else {
values[key] = value;
}
this.setSettingsModel(values);
},
updateElementModel: function updateElementModel( value, input ) {
var key = input.dataset.setting;
this.setValue(key, value);
},
}, {
// Static methods
getStyleValue: function getStyleValue( placeholder, controlValue ) {
if ( !_.isObject( controlValue ) ) {
return ''; // invalid
}
return controlValue[ placeholder ];
}
});
elementor.addControlView( 'cz_sk', StyleKit );
});
})( jQuery, window, document );