Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Made demo a bit more interesting.

  • Loading branch information...
commit 5c6a7837cf6dbff5f5e57c69f9fa03054e849848 1 parent 30717ca
@mcantelon authored
Showing with 17 additions and 13 deletions.
  1. +15 −10 demo/demo3.js
  2. +2 −3 demo3.html
View
25 demo/demo3.js
@@ -16,17 +16,22 @@ function testDirs() {
}
function moveHandler(move) {
- if (move.allowed) {
- move.self.busy();
- $('#message').text(
- 'Dropped ID ' + move.droppedPath + ' onto ' + move.containerPath
- );
- setTimeout(function() {
- move.self.idle();
- $('#message').text('');
- }, 2000);
+ // only allow files to be dropped onto the #dest instance
+ if (move.self.id == 'dest') {
+ if (move.allowed) {
+ move.self.busy();
+ $('#message').text(
+ 'Dropped ID ' + move.droppedPath + ' onto ' + move.containerPath
+ );
+ setTimeout(function() {
+ move.self.idle();
+ $('#message').text('');
+ }, 2000);
+ } else {
+ alert("You can't move a directory into its subdirectory.");
+ }
} else {
- alert("You can't move a directory into its subdirectory.");
+ alert("You're only allowed to drop into the rightmost file explorer.");
}
}
View
5 demo3.html
@@ -15,9 +15,8 @@
<body>
<div>
- <div id='source' class='backbone-file-explorer' style='float:left'>Loading...</div>
-
- <div id='dest' class='backbone-file-explorer' style='float:left'>Loading...</div>
+ <div id='source' class='backbone-file-explorer' style='float:left'></div>
+ <div id='dest' class='backbone-file-explorer' style='float:left'></div>
</div>
<div id='message' style='clear:both'></div>
Please sign in to comment.
Something went wrong with that request. Please try again.