Skip to content

Commit

Permalink
Fixed a slight issue where we could click the change folders button r…
Browse files Browse the repository at this point in the history
…ather than the dropdown arrow #1189
  • Loading branch information
tidusjar committed Feb 25, 2017
1 parent e420d03 commit 5095d30
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 7 additions & 2 deletions Ombi.UI/Content/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,16 +567,21 @@ $(document).on("click", ".change-root-folder", function (e) {
e.preventDefault();
var $this = $(this);
var $button = $this.parents('.btn-split').children('.change').first();
var rootFolderId = e.target.id
var rootFolderId = e.target.id;
var $form = $this.parents('form').first();

var requestId = $button.attr('id');

if ($button.text() === " Loading...") {
return;
}

loadingButton($button.attr('id'), "success");
loadingButton(requestId, "success");

changeRootFolder($form, rootFolderId, function () {
if ($('#' + requestId + "rootPathMain").length) {
$('#' + requestId + "currentRootPath").text($this.text);
}
});

});
Expand Down
6 changes: 3 additions & 3 deletions Ombi.UI/Views/Requests/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
<div>@UI.Requests_RequestedDate: {{requestedDate}}</div>
{{#if admin}}
{{#if currentRootPath}}
<div>Root Path: {{currentRootPath}}</div>
<div class="{{requestId}}rootPathMain">Root Path: <span id="{{requestId}}currentRootPath">{{currentRootPath}}</span></div>
{{/if}}
{{/if}}
<div>
Expand Down Expand Up @@ -285,14 +285,14 @@
<input name="requestId" type="text" value="{{requestId}}" hidden="hidden" />
{{#if_eq hasRootFolders true}}
<div class="btn-group btn-split">
<button type="button" class="btn btn-sm btn-success-outline approve" id="{{requestId}}" custom-button="{{requestId}}">@*<i class="fa fa-plus"></i>*@ Change Root Folder</button>
<button type="button" class="btn btn-sm btn-success-outline" id="changeRootFolderBtn{{requestId}}" custom-button="{{requestId}}">@*<i class="fa fa-plus"></i>*@ Change Root Folder</button>
<button type="button" class="btn btn-success-outline dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">@UI.Requests_ToggleDropdown</span>
</button>
<ul class="dropdown-menu">
{{#each rootFolders}}
<li><a href="#" class="change-root-folder" id="{{id}}">{{path}}</a></li>
<li><a href="#" class="change-root-folder" id="{{id}}" requestId="{{requestId}}">{{path}}</a></li>
{{/each}}
</ul>
</div>
Expand Down

0 comments on commit 5095d30

Please sign in to comment.