mirror of
https://github.com/wassname/slider.git
synced 2026-09-10 12:38:09 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c41239d90 | ||
|
|
19f1183634 | ||
|
|
200d0810ce | ||
|
|
e7007fbe8e | ||
|
|
8f490c80be |
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user