@mjhls/mjh-framework 1.0.960 → 1.0.961

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # mjh-framework v. 1.0.960
1
+ # mjh-framework v. 1.0.961
2
2
 
3
3
  [![NPM](https://img.shields.io/npm/v/mjh-framework.svg)](https://www.npmjs.com/package/mjh-framework) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
4
4
 
@@ -87,7 +87,8 @@ var GridContent = function (_React$Component) {
87
87
  lgInfeedAd: _this.props.lgInfeedAd ? _this.props.lgInfeedAd : false,
88
88
  showCategory: _this.props.showCategory ? _this.props.showCategory : false,
89
89
  contentCategoryMapping: _this.props.contentCategoryMapping ? contentCategoryMapping : [],
90
- lastDataSize: _this.data ? _this.data.length : 0
90
+ lastDataSize: _this.data ? _this.data.length : 0,
91
+ dataRemapped: !_this.props.showBI || !_this.props.brandInsight
91
92
  }, _this.loadMore = debounce.debounce_1(function () {
92
93
  _this.setState(function (state) {
93
94
  var page = state.page,
@@ -115,6 +116,10 @@ var GridContent = function (_React$Component) {
115
116
  if (pageview && currentPath !== prevPath) {
116
117
  pageview(currentPath);
117
118
  }
119
+ // set dataRemap to true as there are no infeed or BI ads or window width is less than limit
120
+ if (typeof window !== 'undefined' && (!_this.props.lgInfeedAd || !_this.props.brandInsight || window.innerWidth < 1400) && !_this.state.dataRemapped) {
121
+ !_this.state.dataRemapped && _this.setState({ dataRemapped: true });
122
+ }
118
123
  }, _this.loadData = function () {
119
124
  var _this$state = _this.state,
120
125
  from = _this$state.from,
@@ -429,6 +434,7 @@ var GridContent = function (_React$Component) {
429
434
  });
430
435
 
431
436
  posts = lodash.lodash.flatten(chunks);
437
+ !this.state.dataRemapped && this.setState({ dataRemapped: true }); // To detect if appending of insights ads are completed
432
438
  }
433
439
 
434
440
  if (showBI) {
@@ -494,6 +500,10 @@ var GridContent = function (_React$Component) {
494
500
  var itemsPerPage = this.props.params && this.props.params.itemsPerPage ? this.props.params.itemsPerPage : 10;
495
501
  var heroContent = this.props.heroContent ? this.props.heroContent : 0;
496
502
  var featureCount = 0;
503
+ if (!this.state.dataRemapped) {
504
+ //For Javascript Disabled Cases. data is not remapped if JS is disabled.
505
+ posts = this.state.data;
506
+ }
497
507
  return React__default['default'].createElement(
498
508
  'div',
499
509
  { className: 'grid-container' },
@@ -77,7 +77,8 @@ var GridContent = function (_React$Component) {
77
77
  lgInfeedAd: _this.props.lgInfeedAd ? _this.props.lgInfeedAd : false,
78
78
  showCategory: _this.props.showCategory ? _this.props.showCategory : false,
79
79
  contentCategoryMapping: _this.props.contentCategoryMapping ? contentCategoryMapping : [],
80
- lastDataSize: _this.data ? _this.data.length : 0
80
+ lastDataSize: _this.data ? _this.data.length : 0,
81
+ dataRemapped: !_this.props.showBI || !_this.props.brandInsight
81
82
  }, _this.loadMore = debounce_1(function () {
82
83
  _this.setState(function (state) {
83
84
  var page = state.page,
@@ -105,6 +106,10 @@ var GridContent = function (_React$Component) {
105
106
  if (pageview && currentPath !== prevPath) {
106
107
  pageview(currentPath);
107
108
  }
109
+ // set dataRemap to true as there are no infeed or BI ads or window width is less than limit
110
+ if (typeof window !== 'undefined' && (!_this.props.lgInfeedAd || !_this.props.brandInsight || window.innerWidth < 1400) && !_this.state.dataRemapped) {
111
+ !_this.state.dataRemapped && _this.setState({ dataRemapped: true });
112
+ }
108
113
  }, _this.loadData = function () {
109
114
  var _this$state = _this.state,
110
115
  from = _this$state.from,
@@ -419,6 +424,7 @@ var GridContent = function (_React$Component) {
419
424
  });
420
425
 
421
426
  posts = lodash.flatten(chunks);
427
+ !this.state.dataRemapped && this.setState({ dataRemapped: true }); // To detect if appending of insights ads are completed
422
428
  }
423
429
 
424
430
  if (showBI) {
@@ -484,6 +490,10 @@ var GridContent = function (_React$Component) {
484
490
  var itemsPerPage = this.props.params && this.props.params.itemsPerPage ? this.props.params.itemsPerPage : 10;
485
491
  var heroContent = this.props.heroContent ? this.props.heroContent : 0;
486
492
  var featureCount = 0;
493
+ if (!this.state.dataRemapped) {
494
+ //For Javascript Disabled Cases. data is not remapped if JS is disabled.
495
+ posts = this.state.data;
496
+ }
487
497
  return React__default.createElement(
488
498
  'div',
489
499
  { className: 'grid-container' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.960",
3
+ "version": "1.0.961",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",