react-i13n
Advanced tools
Comparing version 0.1.25 to 0.1.26
@@ -319,3 +319,3 @@ /** | ||
// detect viewport from the root, and skip all children's detection if it's not in the viewport | ||
self._detectViewport(function detectCallback () { | ||
self._detectViewport(null, null, function detectCallback () { | ||
if (self._i13nNode.isInViewport()) { | ||
@@ -322,0 +322,0 @@ self._i13nNode.getChildrenNodes().forEach(function detectChildrenViewport (childNode) { |
@@ -9,14 +9,7 @@ /** | ||
var React = require('react/addons'); | ||
var subscribe = require('subscribe-ui-event').subscribe; | ||
var MsgMixin = require('./MessageMixin'); | ||
if (typeof window !== 'undefined') { | ||
require('./scroll'); | ||
require('./visibility'); | ||
} | ||
/* Viewport mixin assumes you are on browser and already have the scroll lib */ | ||
var Viewport = { | ||
mixins: [MsgMixin], | ||
propTypes: { | ||
@@ -57,3 +50,3 @@ viewport: React.PropTypes.shape({ | ||
_detectViewport: function (callback) { | ||
_detectViewport: function (err, payload, callback) { | ||
var self = this; | ||
@@ -80,7 +73,7 @@ if (!self.isMounted()) { | ||
subscribeViewportEvents: function () { | ||
this.subscribe('scroll', this._detectViewport); | ||
this.subscription = subscribe('scrollEnd', this._detectViewport); | ||
}, | ||
unsubscribeViewportEvents: function () { | ||
this.unsubscribe('scroll'); | ||
this.subscription.unsubscribe(); | ||
}, | ||
@@ -87,0 +80,0 @@ |
@@ -10,2 +10,17 @@ /** | ||
function checkHidden (DOMNode) { | ||
if (DOMNode !== document) { | ||
var styles = window.getComputedStyle(DOMNode) || {}; | ||
if ('none' === styles.display || | ||
'hidden' === styles.visibility || | ||
'0' === styles.opacity) { | ||
return true; | ||
} else { | ||
return checkHidden(DOMNode.parentNode); | ||
} | ||
} else { | ||
return false; | ||
} | ||
} | ||
function setupContainerPosition (DOMNode, container, dashboard) { | ||
@@ -53,2 +68,5 @@ var offset = cumulativeOffset(DOMNode); | ||
} | ||
if (checkHidden(DOMNode)) { | ||
return; | ||
} | ||
var container = document.createElement('div'); | ||
@@ -55,0 +73,0 @@ container.id = 'i13n-debug-' + uniqueId; |
{ | ||
"name": "react-i13n", | ||
"description": "React I13n provides a performant and scalable solution to application instrumentation.", | ||
"version": "0.1.25", | ||
"version": "0.1.26", | ||
"main": "index.js", | ||
@@ -17,7 +17,7 @@ "repository": { | ||
"debug": "^2.1.3", | ||
"eventemitter3": "^1.0.0", | ||
"hoist-non-react-statics": "^1.0.0", | ||
"object-assign": "^4.0.0", | ||
"promise": "^7.0.1", | ||
"setimmediate": "^1.0.2" | ||
"setimmediate": "^1.0.2", | ||
"subscribe-ui-event": "^0.2.2" | ||
}, | ||
@@ -32,3 +32,3 @@ "devDependencies": { | ||
"grunt-contrib-clean": "^0.6.0", | ||
"grunt-contrib-connect": "^0.10.1", | ||
"grunt-contrib-connect": "^0.11.2", | ||
"grunt-contrib-jshint": "^0.11.2", | ||
@@ -43,3 +43,3 @@ "grunt-contrib-watch": "^0.6.1", | ||
"jshint": "^2.5.1", | ||
"minimist": "^0.2.0", | ||
"minimist": "^1.2.0", | ||
"mocha": "^2.0", | ||
@@ -50,3 +50,3 @@ "mockery": "^1.4.0", | ||
"react-tools": "<= 0.13.x", | ||
"xunit-file": "^0.0.5" | ||
"xunit-file": "^0.0.7" | ||
}, | ||
@@ -53,0 +53,0 @@ "keywords": [ |
# react-i13n | ||
[![npm version](https://badge.fury.io/js/react-i13n.svg)](http://badge.fury.io/js/react-i13n) [![Build Status](https://travis-ci.org/yahoo/react-i13n.svg?branch=master)](https://travis-ci.org/yahoo/react-i13n) | ||
[![npm version](https://badge.fury.io/js/react-i13n.svg)](http://badge.fury.io/js/react-i13n) | ||
[![Build Status](https://travis-ci.org/yahoo/react-i13n.svg?branch=master)](https://travis-ci.org/yahoo/react-i13n) | ||
[![Coverage Status](https://coveralls.io/repos/yahoo/react-i13n/badge.svg?branch=master&service=github)](https://coveralls.io/github/yahoo/react-i13n?branch=master) | ||
[![Dependency Status](https://david-dm.org/yahoo/react-i13n.svg)](https://david-dm.org/yahoo/react-i13n) | ||
[![devDependency Status](https://david-dm.org/yahoo/react-i13n/dev-status.svg)](https://david-dm.org/yahoo/react-i13n#info=devDependencies) | ||
@@ -18,3 +22,3 @@ `react-i13n` provides a performant, scalable and pluggable approach to instrumenting your React application. | ||
* **Adaptable** - If you are using an isomorphic framework (e.g. [Fluxible](http://fluxible.io)) to build your app, you can easily [change the tracking implementation](./docs/guides/createPlugins.md) on the server and client side. For example, to track page views, you can fire an http request on server and xhr request on the client. | ||
* **Optimizable** - We provide an option to enable viewport checking for each `I13nNode`. Which means that data will only be beaconed when the node is in the viewport. This reduces the network usage for the user and provides better tracking details. | ||
* **Optimizable** - We provide an option to enable viewport (integrating [subscribe-ui-event](https://github.com/yahoo/subscribe-ui-event)) checking for each `I13nNode`. Which means that data will only be beaconed when the node is in the viewport. This reduces the network usage for the user and provides better tracking details. | ||
* **Auto Scan Links** - Support [auto scan links](./docs/api/createI13nNode.md) for the cases you are not able to replace the component you are using to get it tracked, e.g., if you have dependencies or you are using `dangerouslySetInnerHTML`. We scan the tags you define on client side, track them and build nodes for them in i13n tree. | ||
@@ -21,0 +25,0 @@ |
Sorry, the diff of this file is not supported yet
146
73123
21
1753
+ Addedsubscribe-ui-event@^0.2.2
+ Addedlodash._getnative@3.9.1(transitive)
+ Addedlodash.debounce@3.1.1(transitive)
+ Addedlodash.throttle@3.0.4(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedraf@3.4.1(transitive)
+ Addedsubscribe-ui-event@0.2.10(transitive)
- Removedeventemitter3@^1.0.0