Browse Source

make primary page button

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

+ 1
- 0
www/index.html View File

<img class="autodoc_document_image img-fluid" /> <img class="autodoc_document_image img-fluid" />
</div> </div>
</div> </div>
<div class="row"><div class="col"><button type="button" class="autodoc_document_btn_primary btn btn-sm btn-outline-primary">Make primary page</button></div>
</div> </div>
</div> </div>



+ 20
- 0
www/js/autodoc.js View File

$('.autodoc_home_modal_tags_add').removeClass('d-none'); $('.autodoc_home_modal_tags_add').removeClass('d-none');
}); });


// document page
// make primary button
$('.autodoc_document_btn_primary').click(function(e) {
$(e.target).addClass('disabled');
var docid = $('.autodoc_tab_document').data('docid');
var pageid = $('.autodoc_document_image').data('pageid');

$.ajax({
type: "PATCH",
url: conf.openapi + "/documents/" + docid + "?primarypage=" + pageid,
success: function () {
$('autodoc_document_btn_primary').removeClass('disabled');
}
});

});

// tag menu select // tag menu select
$('.autodoc_tag_list').change(function (e) { $('.autodoc_tag_list').change(function (e) {
console.log(e); console.log(e);
$('.autodoc_document_image').attr('src', $('.autodoc_document_image').attr('src',
conf.openapi + "/pages/" + $(e.target).parent().data('pageid') + "/image" conf.openapi + "/pages/" + $(e.target).parent().data('pageid') + "/image"
); );
$('.autodoc_document_image').data('pageid', doc.pageId[i]);
}); });
$('.autodoc_document_carousel').append(item); $('.autodoc_document_carousel').append(item);


} }
$('.autodoc_document_image').attr('src', conf.openapi + "/pages/" + doc.primaryPage + "/image"); $('.autodoc_document_image').attr('src', conf.openapi + "/pages/" + doc.primaryPage + "/image");
$('.autodoc_document_image').data('pageid', doc.primaryPage);

$('.autodoc_document_carousel').slick({ $('.autodoc_document_carousel').slick({
lazyLoad: 'ondemand', lazyLoad: 'ondemand',
slidesToShow: 3, slidesToShow: 3,

Loading…
Cancel
Save