Current Path : /var/www/u0635749/data/www/hobbyclick.ru/public/hobbyclick/bitrix/js/landing/node/ |
Current File : /var/www/u0635749/data/www/hobbyclick.ru/public/hobbyclick/bitrix/js/landing/node/icon.min.js |
(function(){"use strict";BX.namespace("BX.Landing.Block.Node");var t=BX.Landing.Utils.encodeDataValue;var n=BX.Landing.Utils.decodeDataValue;var e=BX.Landing.Utils.data;var i=BX.Landing.Utils.attr;BX.Landing.Block.Node.Icon=function(t){BX.Landing.Block.Node.Img.apply(this,arguments);this.type="icon"};function s(t){var n=e(t.node,"data-pseudo-url");return!!n?n:""}function a(t){return t.node.className.split(" ")}function o(t,n){return BX.Landing.UI.Panel.IconPanel.getLibraries().then(function(e){e.forEach(function(n){n.categories.forEach(function(n){n.items.forEach(function(n){var e=n.split(" ");e.forEach(function(n){if(n){t.node.classList.remove(n)}})})})});n.classList.forEach(function(n){t.node.classList.add(n)})})}BX.Landing.Block.Node.Icon.prototype={constructor:BX.Landing.Block.Node.Icon,__proto__:BX.Landing.Block.Node.Img.prototype,getField:function(){if(!this.field){var t=this.getValue();t.url=n(t.url);var e=!!this.node.closest("a");this.field=new BX.Landing.UI.Field.Icon({selector:this.selector,title:this.manifest.name,disableLink:e,content:t,dimensions:!!this.manifest.dimensions?this.manifest.dimensions:{}})}else{this.field.content=this.getValue()}return this.field},setValue:function(t,n,e){this.lastValue=this.lastValue||this.getValue();this.preventSave(n);return o(this,t).then(function(){if(t.url){i(this.node,"data-pseudo-url",t.url)}this.onChange();if(!e){BX.Landing.History.getInstance().push(new BX.Landing.History.Entry({block:this.getBlock().id,selector:this.selector,command:"editIcon",undo:this.lastValue,redo:this.getValue()}))}this.lastValue=this.getValue()}.bind(this))},getValue:function(){return{type:"icon",src:"",id:-1,alt:"",classList:a(this),url:t(s(this))}}}})(); //# sourceMappingURL=icon.map.js