| @@ -80,13 +80,13 @@ $(document).ready(function () { | |||
| }); | |||
| // tag menu select | |||
| $('.autodoc_tag_list').change(function(e) { | |||
| $('.autodoc_tag_list').change(function (e) { | |||
| console.log(e); | |||
| var tagId = $('.autodoc_tag_list').val(); | |||
| var tagName = $('.autodoc_tag_list').children("option:selected").html(); | |||
| var tagId = $('.autodoc_tag_list').val(); | |||
| var tagName = $('.autodoc_tag_list').children("option:selected").html(); | |||
| var tagColor = $('.autodoc_tag_list').children("option:selected").attr('data'); | |||
| if ( tagId == "" ) { | |||
| if (tagId == "") { | |||
| $(".autodoc_tag_list").addClass('d-none'); | |||
| $(".autodoc_tag_text").removeClass('d-none'); | |||
| $('.autodoc_tag_text').val(''); | |||
| @@ -104,7 +104,7 @@ $(document).ready(function () { | |||
| }); | |||
| // tag add button | |||
| $('.autodoc_tag_add').click(function(e) { | |||
| $('.autodoc_tag_add').click(function (e) { | |||
| var tagId = $('.autodoc_tag_id').val(); | |||
| var tagName = $('.autodoc_tag_text').val(); | |||
| var tagColor = $('.autodoc_tag_color.active').attr('data').split('_').pop(); | |||
| @@ -112,7 +112,7 @@ $(document).ready(function () { | |||
| var urlparam = "tagName=" + encodeURIComponent(tagName) + "&tagColor=" + encodeURIComponent(tagColor); | |||
| var method = "POST"; | |||
| if ( tagId != "" ) { | |||
| if (tagId != "") { | |||
| method = "PATCH"; | |||
| url += tagId; | |||
| } | |||
| @@ -120,20 +120,21 @@ $(document).ready(function () { | |||
| $.ajax({ | |||
| type: method, | |||
| url: url + '?' + urlparam, | |||
| success: function() { | |||
| success: function () { | |||
| location.reload(); | |||
| } | |||
| }); | |||
| }); | |||
| $('.autodoc_tag_delete').click(function(e) { | |||
| // tags delete event | |||
| $('.autodoc_tag_delete').click(function (e) { | |||
| var tagId = $('.autodoc_tag_id').val(); | |||
| if ( tag != "" ) { | |||
| if (tag != "") { | |||
| $.ajax({ | |||
| type: "DELETE", | |||
| url = conf.openapi + "/tags/" + tagId, | |||
| success: function() { location.reload(); } | |||
| url: conf.openapi + "/tags/" + tagId, | |||
| success: function () { location.reload(); } | |||
| }); | |||
| } | |||
| else { | |||
| @@ -234,8 +235,8 @@ function page_load_upload() { | |||
| function page_load_tags() { | |||
| // update tag list | |||
| $.getJSON(conf.openapi + "/tags", function(tags) { | |||
| $.each(tags, function(n, tag) { | |||
| $.getJSON(conf.openapi + "/tags", function (tags) { | |||
| $.each(tags, function (n, tag) { | |||
| $('.autodoc_tag_list').append( | |||
| '<option data="' + tag.color + '" value="' + tag.id + '">' + | |||
| tag.name + | |||