Skip to content

Commit

Permalink
Fix warning in React 0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Nov 14, 2015
1 parent f7a5ec1 commit cf978ea
Show file tree
Hide file tree
Showing 7 changed files with 184 additions and 185 deletions.
6 changes: 3 additions & 3 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ <h2>License:</h2>
<p>MIT-licensed.</p>
</div>

<script src="//fb.me/react-0.12.2.js"></script>
<script src="js/event-listener.js"></script>
<script src="../element-pan.js"></script>
<script src="https://fb.me/react-0.14.2.js"></script>
<script src="https://fb.me/react-dom-0.14.2.js"></script>
<script src="../umd/element-pan.min.js"></script>
<script src="js/demo.js"></script>

</body>
Expand Down
13 changes: 7 additions & 6 deletions demo/js/demo.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
'use strict';

var require = typeof require === 'undefined' ? function() {} : require;

var React = window.React || require('react');
var ReactDom = window.ReactDOM || require('react-dom') || React;
var ElementPan = React.createFactory(window.reactElementPan || require('react-element-pan'));

React.initializeTouchEvents(true);

// Simple image demo
React.render(
ReactDom.render(
new ElementPan({
startX: 771,
startY: 360
}, React.DOM.img({ src: 'img/beer.jpg' })
), document.getElementById('image-demo'));

// Huge SVG demo
React.render(
ReactDom.render(
new ElementPan({
startX: 1771,
startY: 1360
Expand All @@ -27,13 +28,13 @@ while (--i) {
themDivs.push(React.DOM.div({
key: i,
style: {
width: i * 30,
width: i * 30,
lineHeight: (i * 10) + 'px'
}
}, 'Smaller...'));
}

React.render(
ReactDom.render(
new ElementPan(null, themDivs),
document.getElementById('html-demo')
);
14 changes: 0 additions & 14 deletions demo/js/event-listener.js

This file was deleted.

157 changes: 0 additions & 157 deletions element-pan.js

This file was deleted.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
"version": "1.0.2",
"description": "React component for allowing panning of DOM-elements too large for their container, in a Google Maps-like way.",
"main": "element-pan.js",
"browser": "./umd/element-pan.js",
"scripts": {
"test": "eslint .",
"build": "browserify element-pan.js -o vendor/imboclient-3.1.1.js -s reactElementPan"
"build": "npm run build:umd && npm run build:prod",
"build:umd": "webpack src/element-pan.js umd/element-pan.js",
"build:prod": "NODE_ENV=production webpack -p src/element-pan.js umd/element-pan.min.js"
},
"repository": {
"type": "git",
"url": "git@github.com:rexxars/react-element-pan.git"
},
"browserify-shim": {
"react": "global:React"
},
"keywords": [
"react",
"react-component",
Expand All @@ -31,7 +31,8 @@
"homepage": "https://github.com/rexxars/react-element-pan",
"devDependencies": {
"eslint": "^1.9.0",
"eslint-config-vaffel": "^3.0.0"
"eslint-config-vaffel": "^3.0.0",
"webpack": "^1.12.6"
},
"dependencies": {
"eventlistener": "0.0.1"
Expand Down
Loading

0 comments on commit cf978ea

Please sign in to comment.