Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@
margin: 0 50px;
}

.react-draggable, .cursor {
cursor: move;
}
.no-cursor {
cursor: auto;
}
.cursor-y {
cursor: ns-resize;
}
.cursor-x {
cursor: ew-resize;
}

.react-draggable strong {
background: #ddd;
border: 1px solid #999;
Expand All @@ -36,3 +49,5 @@
</head>
<body>
<script src="../build/bundle.js"></script>
</body>
</html>
10 changes: 5 additions & 5 deletions example/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ var App = React.createClass({
<div className="box">I can be dragged anywhere</div>
</Draggable>
<Draggable axis="x" zIndex={100}>
<div className="box">I can only be dragged horizonally</div>
<div className="box cursor-x">I can only be dragged horizonally</div>
</Draggable>
<Draggable axis="y" zIndex={100}>
<div className="box">I can only be dragged vertically</div>
<div className="box cursor-y">I can only be dragged vertically</div>
</Draggable>
<Draggable onDrag={this.handleDrag} zIndex={100}>
<div className="box">
Expand All @@ -46,14 +46,14 @@ var App = React.createClass({
</div>
</Draggable>
<Draggable handle="strong" zIndex={100}>
<div className="box">
<strong>Drag here</strong>
<div className="box no-cursor">
<strong className="cursor">Drag here</strong>
<div>You must click my handle to drag me</div>
</div>
</Draggable>
<Draggable cancel="strong" zIndex={100}>
<div className="box">
<strong>Can't drag here</strong>
<strong className="no-cursor">Can't drag here</strong>
<div>Dragging here works</div>
</div>
</Draggable>
Expand Down