Browse Source

edit tags

master
Pascal Gloor 5 years ago
parent
commit
08d72a4a6c
2 changed files with 22 additions and 3 deletions
  1. 1
    0
      www/index.html
  2. 21
    3
      www/js/autodoc.js

+ 1
- 0
www/index.html View File

@@ -220,6 +220,7 @@
<select class="custom-select autodoc_tag_list">
<option>Choose tag to edit</option>
</select>
<input type="hidden" class="autodoc_tag_id" value="">
<input type="text" placeholder="Tag name" class="autodoc_tag_text d-none">
</td>
</tr>

+ 21
- 3
www/js/autodoc.js View File

@@ -79,6 +79,26 @@ $(document).ready(function () {
document_update_name(docid, $(e.target).val(), docid);
});

// tag menu select
$('.autodoc_tag_list').change(function(e) {
var tagId = $('.autodoc_tag_list').val();
var tagName = $('.autodoc_tag_list').html();
var tagColor = $('.autodoc_tag_list').attr('data');

if ( tagId == "" ) {
$(".autodoc_tag_list").addClass('d-none');
$(".autodoc_tag_text").removeClass('d-none');
$('.autodoc_tag_text').val('');
$('.autodoc_tag_color.btn-primary').click();
$('.autodoc_tag_id').val('');
}
else {
$('.autodoc_tag_text').val(tagName);
$('.autodoc_tag_color.btn-' + tagColor).click();
$('.autodoc_tag_id').val(tagId);
}
});

// tag add color events
$('.autodoc_tag_color').click(function (e) {
var btn = e.target;
@@ -180,9 +200,7 @@ function page_load_tags() {
'</option>'
);
});
console.log(data);
}
);
});
}

function document_load() {

Loading…
Cancel
Save