mirror of
https://github.com/wassname/slider.git
synced 2026-09-10 12:38:09 +08:00
update
This commit is contained in:
+25
-8
@@ -1,19 +1,36 @@
|
||||
language: node_js
|
||||
|
||||
notifications:
|
||||
email:
|
||||
- yiminghe@gmail.com
|
||||
|
||||
node_js:
|
||||
- 0.12
|
||||
before_script:
|
||||
- npm start &
|
||||
- npm install mocha-phantomjs -g
|
||||
- phantomjs --version
|
||||
|
||||
before_install:
|
||||
- |
|
||||
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md$)|(^(docs|examples))/'
|
||||
then
|
||||
echo "Only docs were updated, stopping build process."
|
||||
exit
|
||||
fi
|
||||
npm install mocha-phantomjs -g
|
||||
phantomjs --version
|
||||
|
||||
script:
|
||||
- npm test
|
||||
- npm run browser-test
|
||||
- npm run browser-test-cover
|
||||
- npm run saucelabs
|
||||
- |
|
||||
if [ "$TEST_TYPE" = test ]; then
|
||||
npm test
|
||||
else
|
||||
npm run $TEST_TYPE
|
||||
fi
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- TEST_TYPE=lint
|
||||
- TEST_TYPE=browser-test
|
||||
- TEST_TYPE=browser-test-cover
|
||||
- TEST_TYPE=saucelabs
|
||||
global:
|
||||
- secure: S1VwbaPzLnSH/IUT/wlJulxAX5VHRIDmSt53h/ycHcZsszUpWcLCJRQAe0fTVB2dAx5MdBbSZ+o+tr3tRwVB5TRAYm0oTCsYAkOZaWOB28RuUQtdGt3wf9xxTG1UiPiaLLUW3waX9zAaf3yqKBcJGf1op0RD8dksxbCFw/7xVbU=
|
||||
- secure: EBEDg8k///IlEsnx0AE8X3mbFl0QE5+xGKbG4AxXlGZda12uTIPUSMKJzdZQ2hVbZXduTzf1cQl9rcu9nGoSnkL/DWnIax9cvHi+1orx5+YPlxPHNWAwWByTnHosBn2MJhfy1s5paJfHC9cUzmmEL6x4fYthWxjsPUo+irEZH6E=
|
||||
|
||||
+2
-2
@@ -39,7 +39,7 @@
|
||||
&:active {
|
||||
border-color: #2db7f5;
|
||||
background-color: #2db7f5;
|
||||
box-shadow: 0 0 0 5px rgba(45, 183, 245, .3);
|
||||
box-shadow: 0 0 3px rgba(45, 183, 245, .75);
|
||||
}
|
||||
&:hover {
|
||||
border-color: #23c0fa;
|
||||
@@ -56,7 +56,7 @@
|
||||
font-size: 12px;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
|
||||
&-mark-text {
|
||||
position: absolute;
|
||||
display: inline-block;
|
||||
|
||||
+1
-1
@@ -3,6 +3,6 @@
|
||||
require('rc-slider/assets/index.css');
|
||||
var Slider = require('rc-slider');
|
||||
var React = require('react');
|
||||
// React.render(<Sliders marks={["一","二","三","四","五"]} index={3}/>, document.getElementById('__react-content'));
|
||||
// React.render(<Slider marks={["一","二","三","四","五"]} index={3}/>, document.getElementById('__react-content'));
|
||||
// React.render(<Slider className='rc-slider' step={20}/>, document.getElementById('__react-content'));
|
||||
React.render(<Slider />, document.getElementById('__react-content'));
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/** @jsx React.DOM */
|
||||
var React = require('react');
|
||||
var EventListener = require('./EventListener');
|
||||
var DomUtils = require('rc-util').Dom;
|
||||
|
||||
function pauseEvent(e) {
|
||||
if (e.stopPropagation) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
}
|
||||
if (e.preventDefault) {
|
||||
e.preventDefault();
|
||||
}
|
||||
@@ -72,7 +72,7 @@ var Slider = React.createClass({
|
||||
},
|
||||
|
||||
componentDidMount: function() {
|
||||
this._onHandleResizeListener = EventListener.listen(window, 'resize', this.handleResize);
|
||||
this._onHandleResizeListener = DomUtils.addEventListener(window, 'resize', this.handleResize);
|
||||
this.handleResize();
|
||||
},
|
||||
|
||||
@@ -88,7 +88,7 @@ var Slider = React.createClass({
|
||||
|
||||
getIndex: function() {
|
||||
var props = this.props;
|
||||
if (props.marks.length === 0) {
|
||||
if (props.marks.length === 0) {
|
||||
return;
|
||||
}
|
||||
var value = this.state.value;
|
||||
@@ -150,8 +150,8 @@ var Slider = React.createClass({
|
||||
},
|
||||
|
||||
_addEventHandles: function() {
|
||||
this._onMouseMoveListener = EventListener.listen(document, 'mousemove', this._onMouseMove);
|
||||
this._onMouseUpListener = EventListener.listen(document, 'mouseup', this._onMouseUp);
|
||||
this._onMouseMoveListener = DomUtils.addEventListener(document, 'mousemove', this._onMouseMove);
|
||||
this._onMouseUpListener = DomUtils.addEventListener(document, 'mouseup', this._onMouseUp);
|
||||
},
|
||||
|
||||
_removeEventHandles: function () {
|
||||
@@ -213,7 +213,7 @@ var Slider = React.createClass({
|
||||
|
||||
var sliderMin = rect.left;
|
||||
var sliderMax = rect.right;
|
||||
|
||||
|
||||
this.setState({
|
||||
upperBound: slider.clientWidth,
|
||||
sliderLength: Math.abs(sliderMax - sliderMin),
|
||||
@@ -238,7 +238,7 @@ var Slider = React.createClass({
|
||||
return;
|
||||
}
|
||||
var position = this._getMousePosition(e);
|
||||
this._calValueByPos(position,
|
||||
this._calValueByPos(position,
|
||||
() => {
|
||||
this._triggerEvents('onChange');
|
||||
this._start(position);
|
||||
@@ -320,7 +320,7 @@ var Slider = React.createClass({
|
||||
var className = prefixClsFn(prefixCls, 'mark');
|
||||
|
||||
return (
|
||||
<div className={className} onMouseDown={this.handleSliderMouseDown}>
|
||||
<div className={className}>
|
||||
{elements}
|
||||
</div>
|
||||
);
|
||||
+9
-7
@@ -23,7 +23,7 @@
|
||||
"react": "*"
|
||||
}
|
||||
},
|
||||
"config":{
|
||||
"config": {
|
||||
"port": 8000
|
||||
},
|
||||
"scripts": {
|
||||
@@ -34,10 +34,9 @@
|
||||
"start": "node-dev --harmony node_modules/.bin/rc-server",
|
||||
"publish": "spm publish && rc-tools run tag",
|
||||
"lint": "rc-tools run lint",
|
||||
"test": "",
|
||||
"saucelabs": "rc-tools run saucelabs",
|
||||
"browser-test": "rc-tools run browser-test",
|
||||
"browser-test-cover": "rc-tools run browser-test-cover"
|
||||
"saucelabs": "node --harmony node_modules/.bin/rc-tools run saucelabs",
|
||||
"browser-test": "node --harmony node_modules/.bin/rc-tools run browser-test",
|
||||
"browser-test-cover": "node --harmony node_modules/.bin/rc-tools run browser-test-cover"
|
||||
},
|
||||
"devDependencies": {
|
||||
"expect.js": "0.3.x",
|
||||
@@ -45,12 +44,15 @@
|
||||
"rc-server": "2.x",
|
||||
"rc-tools": "2.x",
|
||||
"react": "0.13.x",
|
||||
"node-dev":"2.x",
|
||||
"node-dev": "2.x",
|
||||
"jquery": "^1.11.2",
|
||||
"css-loader": "^0.9.1"
|
||||
},
|
||||
"precommit": [
|
||||
"lint",
|
||||
"less"
|
||||
]
|
||||
],
|
||||
"dependencies": {
|
||||
"rc-util": "^2.0.2"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user