fix saving branch prefix, fixes #260

This commit is contained in:
azivner 2018-12-29 10:35:44 +01:00
parent e02eca87b0
commit 3f8e8f8561
2 changed files with 24 additions and 19 deletions

View file

@ -2,6 +2,7 @@ import treeService from '../services/tree.js';
import server from '../services/server.js';
import treeCache from "../services/tree_cache.js";
import treeUtils from "../services/tree_utils.js";
import infoService from "../services/info.js";
const $dialog = $("#branch-prefix-dialog");
const $form = $("#branch-prefix-form");
@ -35,6 +36,8 @@ async function savePrefix() {
await treeService.setPrefix(branchId, prefix);
$dialog.modal('hide');
infoService.showMessage("Branch prefix has been saved.");
}
$form.submit(() => {

View file

@ -1,31 +1,33 @@
<div id="branch-prefix-dialog" class="modal fade mx-auto" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title mr-auto">Edit branch prefix</h5>
<form id="branch-prefix-form">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title mr-auto">Edit branch prefix</h5>
<button class="help-button" type="button" data-help-page="Tree-concepts#prefix" title="Help on Tree prefix">?</button>
<button class="help-button" type="button" data-help-page="Tree-concepts#prefix" title="Help on Tree prefix">?</button>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-left: 0;">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label for="branch-prefix-input">Prefix: </label> &nbsp;
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-left: 0;">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label for="branch-prefix-input">Prefix: </label> &nbsp;
<div class="input-group">
<input id="branch-prefix-input" class="form-control">
<div class="input-group">
<input id="branch-prefix-input" class="form-control">
<div class="input-group-append">
<div id="branch-prefix-note-title" class="input-group-text"></div>
<div class="input-group-append">
<div id="branch-prefix-note-title" class="input-group-text"></div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary btn-sm">Save</button>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary btn-sm">Save</button>
</div>
</div>
</form>
</div>
</div>