#7 Initial skeleton of the edit function. Need to populate everything and make...

#7 Initial skeleton of the edit function. Need to populate everything and make sure the proper fields are displayed.
parent 56fda4cc
......@@ -240,7 +240,8 @@
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{{ model.editorTitle }}</h5>
<h5 class="modal-title" id="add-suggest-title">{{ model.editorTitle }}</h5>
<h5 class="modal-title" id="edit-suggest-title">Edit Item</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
......@@ -1135,7 +1136,8 @@
});
{% if model.canDeleteNodes %}
$('body').on('click', '[data-action="delete-btn"]', function() {
var $body = $('body');
$body.on('click', '[data-action="delete-btn"]', function() {
var nodeId = parseInt($(this).attr('data-node-id'));
$.ajax({
......@@ -1150,6 +1152,21 @@
}
});
});
$body.on('click', '[data-action="edit-btn"]', function() {
console.log(g_openMarker);
var nodeId = parseInt($(this).attr('data-node-id'));
var $modal = $('#suggest-edit-modal');
$modal.find('select[name="subgroup"]').selectpicker('val', '');
$modal.find('input[name="group"]').val(-1).end()
.find('select[name="icon"]').selectpicker('val', '');
$modal.find('input[name="name"]').val(-1).end();
// TODO Action, Target, Pickup Type, Direction, Notes, Original ID
$modal.modal('show');
});
{% endif %}
</script>
{% endblock %}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment