mirror of
https://github.com/wassname/slider.git
synced 2026-09-11 12:42:49 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2e54dbf4a5 | ||
|
|
bf993350c1 | ||
|
|
8645e8dc68 | ||
|
|
9138dff872 |
+7
-2
@@ -10,5 +10,10 @@ before_script:
|
|||||||
- phantomjs --version
|
- phantomjs --version
|
||||||
script:
|
script:
|
||||||
- npm test
|
- npm test
|
||||||
- npm run-script browser-test
|
- npm run browser-test
|
||||||
- npm run-script browser-test-cover
|
- npm run browser-test-cover
|
||||||
|
- npm run saucelabs
|
||||||
|
env:
|
||||||
|
global:
|
||||||
|
- secure: S1VwbaPzLnSH/IUT/wlJulxAX5VHRIDmSt53h/ycHcZsszUpWcLCJRQAe0fTVB2dAx5MdBbSZ+o+tr3tRwVB5TRAYm0oTCsYAkOZaWOB28RuUQtdGt3wf9xxTG1UiPiaLLUW3waX9zAaf3yqKBcJGf1op0RD8dksxbCFw/7xVbU=
|
||||||
|
- secure: EBEDg8k///IlEsnx0AE8X3mbFl0QE5+xGKbG4AxXlGZda12uTIPUSMKJzdZQ2hVbZXduTzf1cQl9rcu9nGoSnkL/DWnIax9cvHi+1orx5+YPlxPHNWAwWByTnHosBn2MJhfy1s5paJfHC9cUzmmEL6x4fYthWxjsPUo+irEZH6E=
|
||||||
|
|||||||
+1
-1
@@ -39,7 +39,7 @@
|
|||||||
&:active {
|
&:active {
|
||||||
border-color: #2db7f5;
|
border-color: #2db7f5;
|
||||||
background-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 {
|
&:hover {
|
||||||
border-color: #23c0fa;
|
border-color: #23c0fa;
|
||||||
|
|||||||
+1
-1
@@ -3,6 +3,6 @@
|
|||||||
require('rc-slider/assets/index.css');
|
require('rc-slider/assets/index.css');
|
||||||
var Slider = require('rc-slider');
|
var Slider = require('rc-slider');
|
||||||
var React = require('react');
|
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 className='rc-slider' step={20}/>, document.getElementById('__react-content'));
|
||||||
React.render(<Slider />, document.getElementById('__react-content'));
|
React.render(<Slider />, document.getElementById('__react-content'));
|
||||||
|
|||||||
@@ -1,56 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2014 Facebook, Inc.
|
|
||||||
*
|
|
||||||
* This file contains a modified version of:
|
|
||||||
* https://github.com/facebook/react/blob/v0.12.0/src/vendor/stubs/EventListener.js
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*
|
|
||||||
* TODO: remove in favour of solution provided by:
|
|
||||||
* https://github.com/facebook/react/issues/285
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Does not take into account specific nature of platform.
|
|
||||||
*/
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var EventListener = {
|
|
||||||
/**
|
|
||||||
* Listen to DOM events during the bubble phase.
|
|
||||||
*
|
|
||||||
* @param {DOMEventTarget} target DOM element to register listener on.
|
|
||||||
* @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
|
|
||||||
* @param {function} callback Callback function.
|
|
||||||
* @return {object} Object with a `remove` method.
|
|
||||||
*/
|
|
||||||
listen: function listen(target, eventType, callback) {
|
|
||||||
if (target.addEventListener) {
|
|
||||||
target.addEventListener(eventType, callback, false);
|
|
||||||
return {
|
|
||||||
remove: function remove() {
|
|
||||||
target.removeEventListener(eventType, callback, false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
} else if (target.attachEvent) {
|
|
||||||
target.attachEvent('on' + eventType, callback);
|
|
||||||
return {
|
|
||||||
remove: function remove() {
|
|
||||||
target.detachEvent('on' + eventType, callback);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = EventListener;
|
|
||||||
+5
-5
@@ -1,6 +1,6 @@
|
|||||||
/** @jsx React.DOM */
|
/** @jsx React.DOM */
|
||||||
var React = require('react');
|
var React = require('react');
|
||||||
var EventListener = require('./EventListener');
|
var DomUtils = require('rc-util').Dom;
|
||||||
|
|
||||||
function pauseEvent(e) {
|
function pauseEvent(e) {
|
||||||
if (e.stopPropagation) {
|
if (e.stopPropagation) {
|
||||||
@@ -72,7 +72,7 @@ var Slider = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
componentDidMount: function() {
|
componentDidMount: function() {
|
||||||
this._onHandleResizeListener = EventListener.listen(window, 'resize', this.handleResize);
|
this._onHandleResizeListener = DomUtils.addEventListener(window, 'resize', this.handleResize);
|
||||||
this.handleResize();
|
this.handleResize();
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -150,8 +150,8 @@ var Slider = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_addEventHandles: function() {
|
_addEventHandles: function() {
|
||||||
this._onMouseMoveListener = EventListener.listen(document, 'mousemove', this._onMouseMove);
|
this._onMouseMoveListener = DomUtils.addEventListener(document, 'mousemove', this._onMouseMove);
|
||||||
this._onMouseUpListener = EventListener.listen(document, 'mouseup', this._onMouseUp);
|
this._onMouseUpListener = DomUtils.addEventListener(document, 'mouseup', this._onMouseUp);
|
||||||
},
|
},
|
||||||
|
|
||||||
_removeEventHandles: function () {
|
_removeEventHandles: function () {
|
||||||
@@ -320,7 +320,7 @@ var Slider = React.createClass({
|
|||||||
var className = prefixClsFn(prefixCls, 'mark');
|
var className = prefixClsFn(prefixCls, 'mark');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={className} onMouseDown={this.handleSliderMouseDown}>
|
<div className={className}>
|
||||||
{elements}
|
{elements}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
+6
-3
@@ -23,7 +23,7 @@
|
|||||||
"react": "*"
|
"react": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"config":{
|
"config": {
|
||||||
"port": 8000
|
"port": 8000
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -45,12 +45,15 @@
|
|||||||
"rc-server": "2.x",
|
"rc-server": "2.x",
|
||||||
"rc-tools": "2.x",
|
"rc-tools": "2.x",
|
||||||
"react": "0.13.x",
|
"react": "0.13.x",
|
||||||
"node-dev":"2.x",
|
"node-dev": "2.x",
|
||||||
"jquery": "^1.11.2",
|
"jquery": "^1.11.2",
|
||||||
"css-loader": "^0.9.1"
|
"css-loader": "^0.9.1"
|
||||||
},
|
},
|
||||||
"precommit": [
|
"precommit": [
|
||||||
"lint",
|
"lint",
|
||||||
"less"
|
"less"
|
||||||
]
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"rc-util": "^2.0.2"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user