Browse Source

more button stuff

master
Pascal Gloor 5 years ago
parent
commit
625105726c
2 changed files with 15 additions and 9 deletions
  1. 8
    8
      www/index.html
  2. 7
    1
      www/js/autodoc.js

+ 8
- 8
www/index.html View File

@@ -232,7 +232,7 @@
</td>
<td>
<div class="btn-group" role="group">
<button type="button" class="btn btn-primary" data="autodoc_tag_color_primary">
<button type="button" class="btn btn-primary autodoc_tag_color" data="autodoc_tag_color_primary">
<span class="autodoc_tag_btn_on d-none">
<i class="fas fa-check"></i>
</span>
@@ -240,7 +240,7 @@
<i class="fas fa-times"></i>
</span>
</button>
<button type="button" class="btn btn-secondary" data="autodoc_tag_color_secondary">
<button type="button" class="btn btn-secondary autodoc_tag_color" data="autodoc_tag_color_secondary">
<span class="autodoc_tag_btn_on d-none">
<i class="fas fa-check"></i>
</span>
@@ -248,7 +248,7 @@
<i class="fas fa-times"></i>
</span>
</button>
<button type="button" class="btn btn-success" data="autodoc_tag_color_success">
<button type="button" class="btn btn-success autodoc_tag_color" data="autodoc_tag_color_success">
<span class="autodoc_tag_btn_on d-none">
<i class="fas fa-check"></i>
</span>
@@ -256,7 +256,7 @@
<i class="fas fa-times"></i>
</span>
</button>
<button type="button" class="btn btn-danger" data="autodoc_tag_color_danger">
<button type="button" class="btn btn-danger autodoc_tag_color" data="autodoc_tag_color_danger">
<span class="autodoc_tag_btn_on d-none">
<i class="fas fa-check"></i>
</span>
@@ -264,7 +264,7 @@
<i class="fas fa-times"></i>
</span>
</button>
<button type="button" class="btn btn-warning" data="autodoc_tag_color_warning">
<button type="button" class="btn btn-warning autodoc_tag_color" data="autodoc_tag_color_warning">
<span class="autodoc_tag_btn_on d-none">
<i class="fas fa-check"></i>
</span>
@@ -272,7 +272,7 @@
<i class="fas fa-times"></i>
</span>
</button>
<button type="button" class="btn btn-info" data="autodoc_tag_color_info">
<button type="button" class="btn btn-info autodoc_tag_color" data="autodoc_tag_color_info">
<span class="autodoc_tag_btn_on d-none">
<i class="fas fa-check"></i>
</span>
@@ -280,7 +280,7 @@
<i class="fas fa-times"></i>
</span>
</button>
<button type="button" class="btn btn-light" data="autodoc_tag_color_light">
<button type="button" class="btn btn-light autodoc_tag_color" data="autodoc_tag_color_light">
<span class="autodoc_tag_btn_on d-none">
<i class="fas fa-check"></i>
</span>
@@ -288,7 +288,7 @@
<i class="fas fa-times"></i>
</span>
</button>
<button type="button" class="btn btn-dark" data="autodoc_tag_color_dark">
<button type="button" class="btn btn-dark autodoc_tag_color" data="autodoc_tag_color_dark">
<span class="autodoc_tag_btn_on d-none">
<i class="fas fa-check"></i>
</span>

+ 7
- 1
www/js/autodoc.js View File

@@ -69,10 +69,16 @@ $(document).ready(function () {
});

$('.autodoc_tag_color').click(function(e) {
console.log(e);
$(e.target).parent().children().removeClass('active');
$(e.target).addClass('active');

$('.autodoc_tag_btn_on').addClass('d-none');
$('.autodoc_tag_btn_off').removeClass('d-none');

$(e.target).children('.autodoc_tag_btn_on').removeClass('d-none');
$(e.target).children('.autodoc_tag_btn_off').addClass('d-none');

$(e.target).parent().children().each(function(id,x) {
var myclass = 'badge-' + $(x).attr('data').split('_').pop();
$('#autodoc_tag_result').removeClass(myclass);

Loading…
Cancel
Save