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 7544bf0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
15 changes: 7 additions & 8 deletions src/mixins/viewport/ViewportMixin.js
Original file line number Diff line number Diff line change
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 Down Expand Up @@ -58,13 +64,6 @@ var Viewport = {

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

Expand Down
3 changes: 0 additions & 3 deletions src/utils/createI13nNode.js
Original file line number Diff line number Diff line change
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 7544bf0

Please sign in to comment.