%PDF- %PDF-
Direktori : /home/bitrix/www/bitrix/js/landing/node/ |
Current File : /home/bitrix/www/bitrix/js/landing/node/embed.min.js |
(function(){"use strict";BX.namespace("BX.Landing");var t=BX.Landing.Utils.data;BX.Landing.Block.Node.Embed=function(t){BX.Landing.Block.Node.apply(this,arguments);this.onAttributeChangeHandler=t.onAttributeChange||function(){};this.lastValue=this.getValue()};BX.Landing.Block.Node.Embed.prototype={constructor:BX.Landing.Block.Node.Embed,__proto__:BX.Landing.Block.Node.prototype,onChange:function(){this.lastValue=this.getValue();this.onAttributeChangeHandler(this);this.onChangeHandler(this)},isChanged:function(){return JSON.stringify(this.getValue())!==JSON.stringify(this.lastValue)},getValue:function(){return{src:this.node.src,source:t(this.node,"data-source")}},setValue:function(e,n,i){this.node.src=e.src;t(this.node,"data-source",e.source);if(this.isChanged()){if(!i){BX.Landing.History.getInstance().push(new BX.Landing.History.Entry({block:this.getBlock().id,selector:this.selector,command:"editEmbed",undo:this.lastValue,redo:this.getValue()}))}this.onChange()}},getField:function(){return new BX.Landing.UI.Field.Embed({title:this.manifest.name,selector:this.selector,content:this.getValue()})}}})();