Skip to content

Commit

Permalink
only when drop file into omni box can upload
Browse files Browse the repository at this point in the history
  • Loading branch information
ti committed Apr 25, 2018
1 parent 1a59b89 commit bada577
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
11 changes: 2 additions & 9 deletions static/files/css/sections/omni.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
}

/*omni upload input icon*/

.upload-label {
padding: 10px;
cursor: pointer;
Expand All @@ -74,15 +75,7 @@
display: none;
}

#dropper {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}

#dropper.dragging {
.omni input.dragging {
opacity: 0.5;
background: lightblue;
z-index: 100;
Expand Down
9 changes: 6 additions & 3 deletions static/files/template/omni.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<!-- dropper uploader -->
<div id="dropper" ondragenter="angular.element(this).scope().dropUploadFile('genter',this, event)" ondragleave="angular.element(this).scope().dropUploadFile('leave',this, event)" ondragover="angular.element(this).scope().dropUploadFile('over',this, event)" ondrop="angular.element(this).scope().dropUploadFile('drop',this, event)"></div>
<!-- MAGNET EDITOR -->
<div class="ui segment" ng-show="edit" >
<form class="ui edit form">
Expand Down Expand Up @@ -42,7 +40,12 @@ <h4 class="ui dividing header">Magnet URI Editor</h4>
placeholder="Enter search query, torrent URL, magnet URI or upload a .torrent file"
ng-model="inputs.omni"
ng-change="parse()"
ng-enter="submitOmni()"/>
ng-enter="submitOmni()"
ondragenter="angular.element(this).scope().dropUploadFile('genter',this, event)"
ondragleave="angular.element(this).scope().dropUploadFile('leave',this, event)"
ondragover="angular.element(this).scope().dropUploadFile('over',this, event)"
ondrop="angular.element(this).scope().dropUploadFile('drop',this, event)"
/>
<div class="upload-icon">
<input type="file" name="upload-input" ng-disabled="mode.search || mode.magnet || mode.torrent" id="upload-input" accept=".torrent" onchange="angular.element(this).scope().uploadFile(this)" />
<label for="upload-input" class="upload-label"><i class="icon" ng-class="{search: mode.search, magnet: mode.magnet || mode.torrent, upload: !mode.search && !mode.magnet && !mode.torrent}"></i></label>
Expand Down

0 comments on commit bada577

Please sign in to comment.