Quellcode durchsuchen

make primary page button

master
Pascal Gloor vor 5 Jahren
Ursprung
Commit
beb1f584a1
2 geänderte Dateien mit 21 neuen und 0 gelöschten Zeilen
  1. 1
    0
      www/index.html
  2. 20
    0
      www/js/autodoc.js

+ 1
- 0
www/index.html Datei anzeigen

@@ -267,6 +267,7 @@
<img class="autodoc_document_image img-fluid" />
</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>


+ 20
- 0
www/js/autodoc.js Datei anzeigen

@@ -86,6 +86,23 @@ $(document).ready(function () {
$('.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
$('.autodoc_tag_list').change(function (e) {
console.log(e);
@@ -285,11 +302,14 @@ function page_load_document(args) {
$('.autodoc_document_image').attr('src',
conf.openapi + "/pages/" + $(e.target).parent().data('pageid') + "/image"
);
$('.autodoc_document_image').data('pageid', doc.pageId[i]);
});
$('.autodoc_document_carousel').append(item);

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

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

Laden…
Abbrechen
Speichern