Current Path : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/landing/ui/field/ |
Current File : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/landing/ui/field/icon_field.min.js |
(function(){"use strict";BX.namespace("BX.Landing.UI.Field");var e=BX.Landing.Utils.clone;BX.Landing.UI.Field.Icon=function(e){BX.Landing.UI.Field.Image.apply(this,arguments);this.uploadButton.layout.innerText=BX.Landing.Loc.getMessage("LANDING_ICONS_FIELD_BUTTON_REPLACE");this.editButton.layout.hidden=true;this.clearButton.layout.hidden=true;this.dropzone.removeEventListener("dragover",this.onDragOver);this.dropzone.removeEventListener("dragleave",this.onDragLeave);this.dropzone.removeEventListener("drop",this.onDrop);this.preview.removeEventListener("dragenter",this.onImageDragEnter);BX.Landing.UI.Panel.IconPanel.getLibraries().then(function(e){if(e.length===0){this.uploadButton.disable()}}.bind(this))};BX.Landing.UI.Field.Icon.prototype={constructor:BX.Landing.UI.Field.Icon,__proto__:BX.Landing.UI.Field.Image.prototype,onUploadClick:function(e){e.preventDefault();BX.Landing.UI.Panel.IconPanel.getInstance().show().then(function(e){this.setValue({type:"icon",classList:e.split(" ")})}.bind(this))},isChanged:function(){return this.getValue().classList.some(function(e){return this.content.classList.indexOf(e)===-1},this)},getValue:function(){var t=this.classList;if(this.selector){var n=this.selector.split("@")[0].replace(".","");t=e(this.classList).concat([n]);t=BX.Landing.Utils.arrayUnique(t)}return{type:"icon",src:"",id:-1,alt:"",classList:t,url:Object.assign({},this.url.getValue(),{enabled:this.urlCheckbox.checked})}},reset:function(){this.setValue({type:"icon",src:"",id:-1,alt:"",classList:[],url:""})}}})(); //# sourceMappingURL=icon_field.map.js