Skip to content

Commit

Permalink
only delete i13nModal
Browse files Browse the repository at this point in the history
  • Loading branch information
kaesonho committed Mar 15, 2016
1 parent 40b1c57 commit 5930ef3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
20 changes: 7 additions & 13 deletions src/mixins/viewport/ViewportMixin.js
Expand Up @@ -7,6 +7,11 @@

var React = require('react');
var subscribe = require('subscribe-ui-event').subscribe;
var DEFAULT_VIEWPORT_MARGINS = {
usePercent: false,
top: 20,
bottom: 20
};

/* Viewport mixin assumes you are on browser and already have the scroll lib */
var Viewport = {
Expand All @@ -30,7 +35,8 @@ var Viewport = {
return callback && callback();
}
var rect = element.getBoundingClientRect();
var viewportMargins = this.props.viewport.margins;
var viewportMargins = Object.assign({}, DEFAULT_VIEWPORT_MARGINS,
(this.props.viewport && this.props.viewport.margins) || {});
var margins;
if (viewportMargins.usePercent) {
margins = {
Expand All @@ -56,18 +62,6 @@ var Viewport = {
self._subComponentsViewportDetection && self._subComponentsViewportDetection();
},

getDefaultProps: function () {
return {
viewport: {
margins: {
usePercent: false,
top: 20,
bottom: 20
}
}
};
},

subscribeViewportEvents: function () {
this.subscription = subscribe('scrollEnd', this._detectViewport);
},
Expand Down
3 changes: 0 additions & 3 deletions src/utils/createI13nNode.js
Expand Up @@ -42,7 +42,6 @@ module.exports = function createI13nNode (Component, defaultProps, options) {
*/
getDefaultProps: function () {
return Object.assign({}, {
model: null,
i13nModel: null,
isLeafNode: false,
bindClickEvent: false,
Expand All @@ -68,9 +67,7 @@ module.exports = function createI13nNode (Component, defaultProps, options) {
}

// delete the props that only used in this level
props.model = undefined;
props.i13nModel = undefined;
props.viewport = undefined;

return React.createElement(
Component,
Expand Down

0 comments on commit 5930ef3

Please sign in to comment.