Skip to content

Commit

Permalink
Add download by pressing Enter key (#444)
Browse files Browse the repository at this point in the history
* add downloads hitting the enter button
  • Loading branch information
lakinduakash authored and malithsen committed Mar 25, 2018
1 parent 65654d5 commit 1294190
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions ui/src/app/dashboard/controllers/DashCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@
});
}
};

$scope.addDownload = function(keyEvent) {
if (keyEvent.which === 13)
$scope.addLink();
}
var getActiveDownloads = function() {
DashService.getDownloads().then(function (response) {
var data = response.data;
Expand Down
4 changes: 2 additions & 2 deletions ui/src/app/views/dashboard.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div layout-gt-md="column" layout-align="center">

<md-content class="add-download-box" >
<md-input-container flex class="downlod-input-box">
<md-input-container flex class="downlod-input-box" ng-keyup="addDownload($event)">
<label>Add download</label>
<input ng-model="dlink.link" name="taskText" type="text" required>
<input ng-model="dlink.link" name="taskText" type="text" required >
</md-input-container>
<md-button class="md-fab md-wayrn md-mini" ng-click="addLink()">
<i class="material-icons">add</i>
Expand Down

0 comments on commit 1294190

Please sign in to comment.