Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only delete i13nModal #83

Merged
merged 1 commit into from
Mar 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 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 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
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