Fixed a slight issue where we could click the change folders button rather than the dropdown arrow #1189

pull/1191/head
tidusjar 8 years ago
parent e420d03a77
commit 5095d30a3c

@ -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);
}
});
});

@ -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>
@ -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>

Loading…
Cancel
Save