Skip to content

Commit

Permalink
Add reset button
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Bishop committed Jun 11, 2018
1 parent 1a741e3 commit feb90b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions static/files/js/omni-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ app.controller("OmniController", function(
}
};

$scope.resetOmni = function() {
$scope.inputs.omni = '';
$scope.parse();
};

$scope.submitTorrent = function() {
if ($scope.mode.torrent) {
api.url($scope.inputs.omni);
Expand Down
7 changes: 5 additions & 2 deletions static/files/template/omni.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ <h4 class="ui dividing header">Magnet URI Editor</h4>
<!-- START TORRENT BUTTONS -->
<div class="search buttons" ng-show="mode.torrent">
<div ng-click="submitTorrent()" class="ui tiny blue button" ng-class="{loading: apiing, disabled: apiing }">
<span ng-show="mode.torrent">Start Torrent</span>
<span>Start Torrent</span>
</div>
<div ng-click="resetOmni()" class="ui tiny button">Reset</div>
</div>

<!-- SEARCH BUTTONS -->
Expand All @@ -56,6 +57,7 @@ <h4 class="ui dividing header">Magnet URI Editor</h4>
<span ng-show="noResults">No results!</span>
<span ng-show="!noResults">Search</span>
</div>
<div ng-click="resetOmni()" class="ui tiny button">Reset</div>
</div>

<div class="ui error message" ng-show="mode.search && !inputs.provider">
Expand Down Expand Up @@ -94,7 +96,8 @@ <h4 class="ui dividing header">Magnet URI Editor</h4>
<div ng-click="submitTorrent()" class="ui tiny blue button" ng-class="{loading: apiing}">
Load Magnet
</div>
<div ng-show="mode.magnet" ng-click="edit = !edit" ng-class="{green: edit}" class="ui tiny button">Edit</div>
<div ng-click="edit = !edit" ng-class="{green: edit}" class="ui tiny button">Edit</div>
<div ng-show="!edit" ng-click="resetOmni()" class="ui tiny button">Reset</div>
</div>

<!-- TORRENT BUTTON -->
Expand Down

0 comments on commit feb90b3

Please sign in to comment.