%PDF- %PDF-
Direktori : /proc/self/root/home/bitrix/www/bitrix/js/landing/ui/field/ |
Current File : //proc/self/root/home/bitrix/www/bitrix/js/landing/ui/field/color_field.min.js |
(function(){"use strict";BX.namespace("BX.Landing.UI.Field");BX.Landing.UI.Field.Color=function(t){BX.Landing.UI.Field.ButtonGroup.apply(this,arguments);this.pseudoElement=typeof t.pseudoElement==="string"?t.pseudoElement:null;this.pseudoClass=typeof t.pseudoClass==="string"?t.pseudoClass:null;this.layout.classList.add("landing-ui-field-color");this.stylePath=t.stylePath;this.initButtons()};function t(t,e,s){var n=document.styleSheets;var o=n.length;for(var l=0;l<o;l++){if("href"in document.styleSheets[l]&&(document.styleSheets[l].href&&document.styleSheets[l].href.indexOf("/templates/landing24/themes/")!==-1||document.styleSheets[l].href&&document.styleSheets[l].href.indexOf("/landing24/template_")!==-1)||s&&document.styleSheets[l].href&&document.styleSheets[l].href.indexOf(s)!==-1){var i=document.styleSheets[l].cssRules;if(i){var a=i.length;for(var u=0;u<a;u++){if(i[u].selectorText===t){return i[u].style[e]}}}}}}BX.Landing.UI.Field.Color.prototype={constructor:BX.Landing.UI.Field.Color,__proto__:BX.Landing.UI.Field.ButtonGroup.prototype,initButtons:function(){this.buttons.forEach(function(e){e.layout.classList.add(e.layout.value);e.layout.innerHTML='<span class="landing-ui-button-inner landing-ui-pattern-transparent"></span>';var s=BX.Landing.UI.Adapter.CSSProperty.get(this.property);if((s!=="background-image"&&s!=="background-color"||this.pseudoElement)&&!this.pseudoClass){BX.DOM.read(function(){var t=getComputedStyle(e.layout,this.pseudoElement).getPropertyValue(s);BX.DOM.write(function(){e.layout.classList.remove(e.layout.value);e.layout.style["background-color"]=t})}.bind(this))}else if(this.pseudoClass){BX.DOM.read(function(){var n=t("."+e.layout.value+this.pseudoClass,s,this.stylePath);BX.DOM.write(function(){e.layout.classList.remove(e.layout.value);e.layout.style["background-color"]=n})}.bind(this))}},this)},reset:function(){this.buttons.forEach(function(t){t.layout.classList.remove("landing-ui-active")})}}})();