{"version":3,"sources":["webpack:///47.52f5a0f9.bundle.js","webpack:///./src/js/components/article/ArticleSeeMore.js"],"names":["webpackJsonp","245","module","exports","__webpack_require__","$","_interopRequireDefault","obj","__esModule","default","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","call","ReferenceError","_inherits","subClass","superClass","prototype","Object","create","constructor","value","enumerable","writable","configurable","setPrototypeOf","__proto__","defineProperty","_createClass","defineProperties","target","props","i","length","descriptor","key","protoProps","staticProps","_component2","_component","_debounce3","_debounce2","ArticleSeeMore","el","_Component","this","dom","$body","$window","window","totalArticleLines","isTruncated","readMore","find","clicked","mobileDotsHeight","contentHeight","$el","outerHeight","element","height","fontSize","css","lineHeight","Math","floor","parseInt","replace","ceil","children","each","index","child","countLines","initReadMore","on","seeMore","bind","refreshWaypoint","e","preventDefault","text","animate","dotdotdot","watch","scrollToTop","show","hide","scrollTop","offset","top","isMobile","countChilds","isMobileDevice","callback","toggleReadMore","Component"],"mappings":"AAAAA,cAAc,KAERC,IACA,SAAUC,EAAQC,EAASC,GAEjC,cAC4B,SAASC,GAkBrC,QAASC,GAAuBC,GAAO,MAAOA,IAAOA,EAAIC,WAAaD,GAAQE,QAASF,GAEvF,QAASG,GAAgBC,EAAUC,GAAe,KAAMD,YAAoBC,IAAgB,KAAM,IAAIC,WAAU,qCAEhH,QAASC,GAA2BC,EAAMC,GAAQ,IAAKD,EAAQ,KAAM,IAAIE,gBAAe,4DAAgE,QAAOD,GAAyB,gBAATA,IAAqC,kBAATA,GAA8BD,EAAPC,EAElO,QAASE,GAAUC,EAAUC,GAAc,GAA0B,kBAAfA,IAA4C,OAAfA,EAAuB,KAAM,IAAIP,WAAU,iEAAoEO,GAAeD,GAASE,UAAYC,OAAOC,OAAOH,GAAcA,EAAWC,WAAaG,aAAeC,MAAON,EAAUO,YAAY,EAAOC,UAAU,EAAMC,cAAc,KAAeR,IAAYE,OAAOO,eAAiBP,OAAOO,eAAeV,EAAUC,GAAcD,EAASW,UAAYV,GA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mDPlB,GC5JoBsD,UD+J7BjG,GAAQM,QChDOqC,IDiDc9B,KAAKb,EAASC,EAAoB","file":"47.52f5a0f9.bundle.js","sourcesContent":["webpackJsonp([47],{\n\n/***/ 245:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function($) {\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; }; }();\n\nvar _component = __webpack_require__(33);\n\nvar _component2 = _interopRequireDefault(_component);\n\nvar _index = __webpack_require__(139);\n\nvar _debounce2 = __webpack_require__(206);\n\nvar _debounce3 = _interopRequireDefault(_debounce2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ArticleSeeMore = function (_Component) {\n _inherits(ArticleSeeMore, _Component);\n\n function ArticleSeeMore(el) {\n _classCallCheck(this, ArticleSeeMore);\n\n return _possibleConstructorReturn(this, (ArticleSeeMore.__proto__ || Object.getPrototypeOf(ArticleSeeMore)).call(this, el));\n }\n\n _createClass(ArticleSeeMore, [{\n key: 'setupDefaults',\n value: function setupDefaults() {\n this.dom = {\n $body: $('body'),\n $window: $(window)\n };\n\n this.totalArticleLines = 0;\n this.isTruncated = false;\n this.readMore = this.dom.$body.find('.read-more');\n this.clicked = false;\n this.mobileDotsHeight = 230;\n this.contentHeight = $(this.$el).outerHeight();\n }\n }, {\n key: 'countLines',\n value: function countLines(element) {\n var height = element.height();\n var fontSize = element.css('font-size');\n var lineHeight = Math.floor(parseInt(fontSize.replace('px', '')) * 1.5);\n var numberOfLines = Math.ceil(height / lineHeight);\n\n return numberOfLines;\n }\n }, {\n key: 'countChilds',\n value: function countChilds() {\n var _this2 = this;\n\n this.totalArticleLines = 0;\n this.$el.children().each(function (index, child) {\n _this2.totalArticleLines += _this2.countLines($(child));\n });\n\n this.initReadMore();\n }\n }, {\n key: 'initReadMore',\n value: function initReadMore() {\n if (this.totalArticleLines > 7) this.mobileDotsHeight = 7 * this.contentHeight / this.totalArticleLines;\n }\n }, {\n key: 'addListeners',\n value: function addListeners() {\n this.readMore.on('click touch', this.seeMore.bind(this));\n this.refreshWaypoint.bind(this);\n this.dom.$window.on('resize load', (0, _debounce3.default)(this.refreshWaypoint.bind(this), 500));\n }\n }, {\n key: 'seeMore',\n value: function seeMore(e) {\n\n e.preventDefault();\n this.clicked = !this.clicked;\n\n if (this.clicked) {\n\n $(this.readMore).find('a').text('Read less about the event');\n $(this.$el).animate({\n height: this.contentHeight\n }, 500);\n this.$el.dotdotdot({\n watch: 'window',\n height: null\n });\n } else {\n $(this.readMore).find('a').text('Read more about the event');\n this.$el.dotdotdot({\n watch: 'window',\n height: this.mobileDotsHeight\n });\n\n $(this.$el).animate({\n height: this.mobileDotsHeight\n }, 500, this.scrollToTop());\n }\n }\n }, {\n key: 'toggleReadMore',\n value: function toggleReadMore() {\n if (this.isTruncated) {\n this.readMore.show();\n } else {\n this.readMore.hide();\n }\n }\n }, {\n key: 'scrollToTop',\n value: function scrollToTop() {\n $('html, body').animate({\n scrollTop: $(this.$el).offset().top\n }, 1000);\n }\n }, {\n key: 'refreshWaypoint',\n value: function refreshWaypoint() {\n var _this3 = this;\n\n if ((0, _index.isMobile)()) {\n this.countChilds();\n if (!this.clicked || !(0, _index.isMobileDevice)()) {\n this.$el.dotdotdot({\n watch: 'window',\n height: this.mobileDotsHeight,\n callback: function callback(isTruncated) {\n return _this3.isTruncated = isTruncated;\n }\n });\n }\n this.toggleReadMore();\n } else {\n this.$el.dotdotdot({\n watch: 'window',\n height: null\n });\n }\n }\n }]);\n\n return ArticleSeeMore;\n}(_component2.default);\n\nexports.default = ArticleSeeMore;\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(10)))\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// 47.52f5a0f9.bundle.js","import Component from 'component';\nimport { isMobile, isMobileDevice } from '../../helpers/index.js';\nimport _debounce from 'lodash/debounce';\n\n\nclass ArticleSeeMore extends Component {\n constructor(el) {\n super(el);\n }\n\n setupDefaults() {\n this.dom = {\n $body: $('body'),\n $window: $(window)\n };\n\n this.totalArticleLines = 0;\n this.isTruncated = false;\n this.readMore = this.dom.$body.find('.read-more');\n this.clicked = false;\n this.mobileDotsHeight = 230;\n this.contentHeight = $(this.$el).outerHeight()\n }\n\n countLines(element) {\n const height = element.height();\n const fontSize = element.css('font-size');\n const lineHeight = Math.floor(parseInt(fontSize.replace('px', '')) * 1.5);\n const numberOfLines = Math.ceil(height / lineHeight);\n\n return numberOfLines;\n }\n\n countChilds() {\n this.totalArticleLines = 0;\n this.$el.children().each((index, child) => {\n this.totalArticleLines += this.countLines($(child));\n });\n\n this.initReadMore();\n }\n\n initReadMore() {\n if (this.totalArticleLines > 7)\n this.mobileDotsHeight = ((7 * this.contentHeight) / this.totalArticleLines);\n }\n\n addListeners() {\n this.readMore.on('click touch', this.seeMore.bind(this));\n this.refreshWaypoint.bind(this);\n this.dom.$window.on('resize load', _debounce(this.refreshWaypoint.bind(this), 500));\n }\n\n seeMore(e) {\n\n e.preventDefault();\n this.clicked = !this.clicked;\n\n if (this.clicked) {\n\n $(this.readMore).find('a').text('Read less about the event')\n $(this.$el).animate({\n height: this.contentHeight\n }, 500)\n this.$el.dotdotdot({\n watch: 'window',\n height: null\n });\n\n } else {\n $(this.readMore).find('a').text('Read more about the event')\n this.$el.dotdotdot({\n watch: 'window',\n height: this.mobileDotsHeight\n });\n\n $(this.$el).animate({\n height: this.mobileDotsHeight\n }, 500, this.scrollToTop());\n }\n }\n\n toggleReadMore() {\n if (this.isTruncated) {\n this.readMore.show();\n } else {\n this.readMore.hide();\n }\n }\n\n scrollToTop() {\n $('html, body').animate({\n scrollTop: $(this.$el).offset().top\n }, 1000);\n }\n\n refreshWaypoint() {\n if (isMobile()) {\n this.countChilds();\n if (!this.clicked || !isMobileDevice()) {\n this.$el.dotdotdot({\n watch: 'window',\n height: this.mobileDotsHeight,\n callback: isTruncated => this.isTruncated = isTruncated\n });\n }\n this.toggleReadMore();\n } else {\n this.$el.dotdotdot({\n watch: 'window',\n height: null\n });\n }\n }\n}\n\nexport default ArticleSeeMore;\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/components/article/ArticleSeeMore.js"],"sourceRoot":""}