Compare commits

...
5 Commits
Author SHA1 Message Date
yiminghe 2c41239d90 fix style. fixes #19 2015-10-14 23:03:46 +08:00
simaQ 19f1183634 update version 2015-08-29 10:58:26 +08:00
simaQ 200d0810ce Merge pull request #21 from danioso/master
Sending new value to _start while dragging
2015-08-29 10:57:19 +08:00
Daniel Osorio e7007fbe8e Sending new value to _start while dragging 2015-08-27 19:23:57 -05:00
yiminghe 8f490c80be up 2015-08-25 21:45:26 +08:00
6 changed files with 28 additions and 20 deletions
+5
View File
@@ -36,3 +36,8 @@ env:
global:
- secure: S1VwbaPzLnSH/IUT/wlJulxAX5VHRIDmSt53h/ycHcZsszUpWcLCJRQAe0fTVB2dAx5MdBbSZ+o+tr3tRwVB5TRAYm0oTCsYAkOZaWOB28RuUQtdGt3wf9xxTG1UiPiaLLUW3waX9zAaf3yqKBcJGf1op0RD8dksxbCFw/7xVbU=
- secure: EBEDg8k///IlEsnx0AE8X3mbFl0QE5+xGKbG4AxXlGZda12uTIPUSMKJzdZQ2hVbZXduTzf1cQl9rcu9nGoSnkL/DWnIax9cvHi+1orx5+YPlxPHNWAwWByTnHosBn2MJhfy1s5paJfHC9cUzmmEL6x4fYthWxjsPUo+irEZH6E=
matrix:
allow_failures:
- env: "TEST_TYPE=saucelabs"
+12 -8
View File
@@ -11,14 +11,14 @@
@ease-out-quint : cubic-bezier(0.23, 1, 0.32, 1);
@ease-in-quint : cubic-bezier(0.755, 0.05, 0.855, 0.06);
* {
.borderBox() {
box-sizing: border-box;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); // remove tap highlight color for mobile safari
}
*:before,
*:after {
box-sizing: border-box;
* {
box-sizing: border-box;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); // remove tap highlight color for mobile safari
}
}
.@{prefixClass} {
@@ -28,6 +28,8 @@
border-radius: @border-radius-base;
background-color: #e9e9e9;
.borderBox();
&-track {
position: absolute;
left: 0;
@@ -138,6 +140,8 @@
z-index: 4;
visibility: visible;
.borderBox();
&-hidden {
display: none;
}
@@ -212,9 +216,9 @@
animation-timing-function: @ease-in-quint;
}
}
.zoom-motion(zoom-down, zoomDown);
.zoom-motion(rc-slider-tooltip-zoom-down, rcSliderTooltipZoomDownOut);
@keyframes zoomDownIn {
@keyframes rcSliderTooltipZoomDownOutIn {
0% {
opacity: 0;
transform-origin: 50% 100%;
@@ -226,7 +230,7 @@
}
}
@keyframes zoomDownOut {
@keyframes rcSliderTooltipZoomDownOutOut {
0% {
transform-origin: 50% 100%;
transform: scale(1, 1);
+1 -1
View File
@@ -11,4 +11,4 @@ function onChange(v){
// React.render(<div style={{width:400,margin:100}}><Slider marks={["一","二","三","四","五"]} defaultIndex={2} /></div>, document.getElementById('__react-content'));
// React.render(<div style={{width:400,margin:100}}><Slider className='rc-slider' step={20}/></div>, document.getElementById('__react-content'));
React.render(<div style={{width:400,margin:100}}><Slider onChange={onChange} tipTransitionName='zoom-down'/></div>, document.getElementById('__react-content'));
React.render(<div style={{width:400,margin:100}}><Slider onChange={onChange} tipTransitionName='rc-slider-tooltip-zoom-down'/></div>, document.getElementById('__react-content'));
+5 -6
View File
@@ -1,6 +1,6 @@
{
"name": "rc-slider",
"version": "1.4.4",
"version": "1.5.0",
"description": "slider ui component for react",
"keywords": [
"react",
@@ -29,13 +29,13 @@
"scripts": {
"build": "rc-tools run build",
"gh-pages": "rc-tools run gh-pages",
"start": "node --harmony node_modules/.bin/rc-server",
"start": "rc-server",
"pub": "rc-tools run pub",
"lint": "rc-tools run lint",
"karma": "rc-tools run karma",
"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"
"saucelabs": "rc-tools run saucelabs",
"browser-test": "rc-tools run browser-test",
"browser-test-cover": "rc-tools run browser-test-cover"
},
"devDependencies": {
"expect.js": "0.3.x",
@@ -43,7 +43,6 @@
"rc-server": "3.x",
"rc-tools": "4.x",
"react": "^0.13.x",
"node-dev": "2.x",
"jquery": "^1.11.2"
},
"precommit": [
+4 -4
View File
@@ -164,7 +164,7 @@ const Slider = React.createClass({
const position = this._getTouchPosition(e);
const value = this._calValueByPos(position);
this._triggerEvents('onChange', value);
this._start(position);
this._start(position, value);
this._addDocumentEvents('touch');
pauseEvent(e);
},
@@ -173,7 +173,7 @@ const Slider = React.createClass({
const position = e.pageX || (e.clientX + document.documentElement.scrollLeft); // to compat ie8
const value = this._calValueByPos(position);
this._triggerEvents('onChange', value);
this._start(position);
this._start(position, value);
this._addDocumentEvents('mouse');
pauseEvent(e);
},
@@ -468,9 +468,9 @@ const Slider = React.createClass({
}
},
_start(position) {
_start(position, value) {
this._triggerEvents('onBeforeChange');
this.startValue = this.state.value;
this.startValue = value;
this.startPosition = position;
this.setState({
dragging: true,
+1 -1
View File
@@ -1,7 +1,7 @@
var expect = require('expect.js');
var Slider = require('../index.js');
var React = require('react');
var React = require('react/addons');
var TestUtils = React.addons.TestUtils;
var Simulate = TestUtils.Simulate;
var $ = require('jquery');