easy3wmui 0.0.42-beta12 → 0.0.42-beta14

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/assets/index.css CHANGED
@@ -134,6 +134,11 @@
134
134
  #Easy3wMGlobalFooter {
135
135
  text-align: center;
136
136
  }
137
+ #Easy3wMGlobalFooter.bottomFixed {
138
+ width: 100%;
139
+ position: fixed;
140
+ bottom: 0;
141
+ }
137
142
  #Easy3wMInsideLayout {
138
143
  overflow: hidden;
139
144
  }
@@ -1,3 +1,8 @@
1
1
  #Easy3wMGlobalFooter {
2
2
  text-align: center;
3
3
  }
4
+ #Easy3wMGlobalFooter.bottomFixed {
5
+ width: 100%;
6
+ position: fixed;
7
+ bottom: 0;
8
+ }
@@ -29,18 +29,55 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'd
29
29
  var Easy3wMGlobalFooter = function (_Component) {
30
30
  (0, _inherits3['default'])(Easy3wMGlobalFooter, _Component);
31
31
 
32
- function Easy3wMGlobalFooter() {
32
+ function Easy3wMGlobalFooter(props) {
33
33
  (0, _classCallCheck3['default'])(this, Easy3wMGlobalFooter);
34
- return (0, _possibleConstructorReturn3['default'])(this, _Component.apply(this, arguments));
34
+
35
+ var _this = (0, _possibleConstructorReturn3['default'])(this, _Component.call(this, props));
36
+
37
+ _this.scrollEvent = function (idName) {
38
+ var element = document.getElementById(idName);
39
+ // console.log('elementelement', element);
40
+ var viewHeight = window.innerHeight; // 目标可视区的高度
41
+ var elementBottom = element.getBoundingClientRect().bottom; // 目标div上边框距离可视区的上边界的距离
42
+ // elementTop === viewHeight div上边框正好与可视区下边框重叠
43
+ if (elementBottom < viewHeight) {
44
+ // 达到目标区域
45
+ // console.log('div出现在可视区!');
46
+ _this.setState({
47
+ bottomFixed: true // 是否固定于页面底部
48
+ });
49
+ }
50
+ };
51
+
52
+ _this.state = {
53
+ bottomFixed: false // 是否固定于页面底部
54
+ };
55
+ return _this;
35
56
  }
36
57
 
58
+ Easy3wMGlobalFooter.prototype.componentDidMount = function componentDidMount() {
59
+ var _this2 = this;
60
+
61
+ window.onload = function () {
62
+ _this2.scrollEvent('Easy3wMGlobalFooter');
63
+ // window.addEventListener('scroll', () => this.scrollEvent('Easy3wMGlobalFooter'));
64
+ };
65
+ };
66
+
67
+ Easy3wMGlobalFooter.prototype.componentWillUnmount = function componentWillUnmount() {}
68
+ // window.removeEventListener('scroll', () => this.scrollEvent('Easy3wMGlobalFooter'));
69
+
70
+ // 滚动事件
71
+ ;
72
+
37
73
  Easy3wMGlobalFooter.prototype.render = function render() {
74
+ var bottomFixed = this.state.bottomFixed;
38
75
  var _props = this.props,
39
76
  className = _props.className,
40
77
  links = _props.links,
41
78
  copyright = _props.copyright;
42
79
 
43
- var clsString = (0, _classnames2['default'])(className);
80
+ var clsString = (0, _classnames2['default'])(className, { bottomFixed: bottomFixed });
44
81
  return _react2['default'].createElement(
45
82
  'div',
46
83
  { id: 'Easy3wMGlobalFooter', className: clsString },
@@ -53,7 +90,8 @@ var Easy3wMGlobalFooter = function (_Component) {
53
90
  {
54
91
  key: link.title,
55
92
  target: link.blankTarget ? '_blank' : '_self',
56
- href: link.href
93
+ href: link.href,
94
+ rel: 'noreferrer'
57
95
  },
58
96
  link.title
59
97
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy3wmui",
3
- "version": "0.0.42-beta12",
3
+ "version": "0.0.42-beta14",
4
4
  "description": "easy3wmui components for react",
5
5
  "keywords": [
6
6
  "react",