(window["webpackJsonp_name_"] = window["webpackJsonp_name_"] || []).push([[66,34,82],{ /***/ 171: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // Function from David Walsh: http://davidwalsh.name/css-animation-callback function whichTransitionEvent() { var t, el = document.createElement('fakeelement'); var transitions = { 'transition': 'transitionend', 'OTransition': 'oTransitionEnd', 'MozTransition': 'transitionend', 'WebkitTransition': 'webkitTransitionEnd' }; for (t in transitions) { if (el.style[t] !== undefined) { return transitions[t]; } } } var transitionEvent = exports.transitionEvent = whichTransitionEvent(); /***/ }), /***/ 209: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); __webpack_require__(430); var _transitionEvent = __webpack_require__(171); function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var AccordionManager = function () { _createClass(AccordionManager, null, [{ key: 'default', get: function get() { return { nodes: null }; } }]); function AccordionManager(params) { _classCallCheck(this, AccordionManager); this._params = Object.assign({}, AccordionManager, params); this._init(); } _createClass(AccordionManager, [{ key: '_init', value: function _init() { if (!this.nodes) { return false; } this.elems = [].concat(_toConsumableArray(this.nodes)); if (!this.elems.length) { return false; } this.elems.forEach(function (elem) { new Accordion({ elem: elem }); }); } }, { key: 'nodes', get: function get() { return this._params.nodes; } }]); return AccordionManager; }(); exports.default = AccordionManager; var Accordion = function () { _createClass(Accordion, null, [{ key: 'default', get: function get() { return { elem: null }; } }]); function Accordion(params) { _classCallCheck(this, Accordion); this._params = Object.assign({}, AccordionManager, params); this.items = [].concat(_toConsumableArray(this.elem.querySelectorAll('.project-accordion__item'))); this.title = [].concat(_toConsumableArray(this.elem.querySelectorAll('.project-accordion__title'))); this.content = [].concat(_toConsumableArray(this.elem.querySelectorAll('.project-accordion__item-content'))); this._init(); } _createClass(Accordion, [{ key: '_init', value: function _init() { if (!this.elem) { return false; } /* * this.setting.active * this.setting.collapseAll */ this.settings = this.elem.getAttribute('data-settings'); try { this.settings = JSON.parse(decodeURIComponent(this.settings)); } catch (e) { this.settings = null; } if (!this.items.length) { return false; } this.content.forEach(function (elem, index) { elem.setAttribute('data-id', index.toString()); elem.addEventListener(_transitionEvent.transitionEvent, function (event) { elem.style.height = ''; }); }); this.title.forEach(function (title, index) { title.setAttribute('data-id', index.toString()); var titleText = title.querySelector('.project-input__accordion-title'); if (title.classList.contains('project-accordion__title_active')) { title.classList.add('project-input_focused'); } if (titleText) { titleText.classList.add('button-text'); } }); this.currentActive = this.settings && this.settings.active ? this.settings.active : 0; if (!this.items[this.currentActive]) { this.currentActive = 0; } this.preActive = this.currentActive; this._initClick(); this._checkElemHeight(); this._resize(); } }, { key: '_initClick', value: function _initClick() { var _this = this; this.elem.addEventListener('click', function (event) { var target = event.target; var action = target.getAttribute('data-action'); var id = target.getAttribute('data-id'); if (action && id) { event.preventDefault(); event.stopPropagation(); id = parseInt(id); _this._action(action, id); } }); } }, { key: '_action', value: function _action(action, id) { switch (action) { case 'open-accordion': this._openAccordion(id); break; default: console.warn('Action is not valid!'); } } }, { key: '_setActive', value: function _setActive() { var _this2 = this; //requestAnimationFrame( () => { this.content[this.currentActive].style.height = this.itemsHeight[this.currentActive] + 'px'; setTimeout(function () { //requestAnimationFrame( () => { _this2.title[_this2.currentActive].classList.add('project-accordion__title_active'); _this2.title[_this2.currentActive].classList.add('project-input_focused'); _this2.items[_this2.currentActive].classList.add('project-accordion__item_active'); //} ); }, 16); //} ); } }, { key: '_clearActive', value: function _clearActive() { var _this3 = this; //requestAnimationFrame( () => { this.itemsHeight[this.preActive] = this.content[this.preActive].getBoundingClientRect().height; //setTimeout( () => { // requestAnimationFrame( () => { this.content[this.preActive].style.height = this.itemsHeight[this.preActive] + 'px'; setTimeout(function () { //requestAnimationFrame( () => { _this3.content[_this3.preActive].style.height = ''; _this3.title[_this3.preActive].classList.remove('project-accordion__title_active'); _this3.title[_this3.preActive].classList.remove('project-input_focused'); _this3.items[_this3.preActive].classList.remove('project-accordion__item_active'); //} ); }, 16); //} ); //}, 16 ); //} ); } }, { key: '_openAccordion', value: function _openAccordion(id) { if (!id && id !== 0) { return false; } if (this.items[id].classList.contains('project-accordion__item_active')) { this.preActive = id; this._clearActive(); return false; } if (this.currentActive === id) { if (this.items[id].classList.contains('project-accordion__item_active')) { this.preActive = id; this._clearActive(); return false; } } this.preActive = this.currentActive; this.currentActive = id; //if ( this.items[ this.preActive ].classList.contains( 'project-accordion__item_active' ) && // (this.settings && this.settings.accordion) ) { if (this.items[this.preActive].classList.contains('project-accordion__item_active')) { this._clearActive(); } this._setActive(); } }, { key: '_checkElemHeight', value: function _checkElemHeight() { var _this4 = this; this.itemsHeight = []; this.content.forEach(function (elem, index) { var hasActive = _this4.items[index].classList.contains('project-accordion__item_active'); _this4.items[index].classList.add('project-accordion__item_active'); _this4.itemsHeight.push(elem.getBoundingClientRect().height); if (!hasActive || index !== _this4.currentActive) { _this4.items[index].classList.remove('project-accordion__item_active'); } }); // } }, { key: '_resize', value: function _resize() { var _this5 = this; window.addEventListener('resize', function () { _this5._checkElemHeight(); }); window.addEventListener('load', function () { _this5._checkElemHeight(); }); } }, { key: 'elem', get: function get() { return this._params.elem; } }]); return Accordion; }(); /***/ }), /***/ 430: /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(452); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(167)(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ 452: /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__(168)(false); // imports // module exports.push([module.i, ".project-accordion__title{position:relative;display:flex;align-items:center;-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;-ms-user-select:none;background-position:50%!important;background-size:cover!important;background-repeat:no-repeat!important;background-color:transparent!important;z-index:1}.project-accordion__title[data-action]{position:relative}.project-accordion__title[data-action]:before{content:none!important}.project-accordion__title[data-action]:after{content:\"\";position:absolute;top:0;left:0;z-index:6;width:100%;height:100%;background-color:rgba(0,0,0,1e-05);cursor:pointer}.project-accordion__title .project-accordion__icon_close,.project-accordion__title .project-accordion__icon_open{flex:0 0 auto;font-size:inherit;color:inherit;height:inherit;width:inherit;line-height:1}.project-accordion__title .project-accordion__icon_close>span,.project-accordion__title .project-accordion__icon_open>span{font-size:inherit;color:inherit;height:inherit;width:inherit;line-height:1;text-align:center}.project-accordion__title .project-accordion__icon_close{display:none}.project-accordion__title .project-accordion__icon_open{display:block}.project-accordion__title-text{flex:1 1 auto}.project-accordion__title_active .project-accordion__icon_close{display:block}.project-accordion__title_active .project-accordion__icon_open{display:none}.project-accordion__item{position:relative}.project-accordion__item_active{display:block}.project-accordion__item_active .project-accordion__item-content{height:auto;pointer-events:auto}.project-accordion__item-content{overflow:hidden;height:0;pointer-events:none;transition:height .2s linear,background .2s linear,box-shadow .2s linear,margin .2s linear,padding .2s linear}.project-accordion__item-content-inner{position:relative;z-index:1}.project-accordion__icon{position:relative}.project-accordion .vc_tta-panel-heading{display:none}.default-accordion,.focus-accordion,.hover-accordion{position:absolute;top:0;left:0;bottom:0;right:0;background-repeat:no-repeat;background-size:contain}.project-input__accordion-bg{position:absolute;top:0;left:0;width:100%;height:100%;z-index:-1;border-radius:inherit;background-position:50%!important;background-size:cover!important;background-repeat:no-repeat!important}.project-accordion__item:not(.project-accordion__item_active) .project-accordion__item-content{box-shadow:none!important;border:none!important;margin-top:0!important;margin-bottom:0!important}", ""]); // exports /***/ }) }]);