Browse Source

yeah

master
Pascal Gloor 5 years ago
parent
commit
763726df5c
1 changed files with 15 additions and 11 deletions
  1. 15
    11
      www/js/autodoc.js

+ 15
- 11
www/js/autodoc.js View File

@@ -81,7 +81,7 @@ $(document).ready(function () {
});

// modal show typeahead
$('.autodoc_home_modal_tags_show').click(function(e) {
$('.autodoc_home_modal_tags_show').click(function (e) {
$('.autodoc_home_modal_tags_show').addClass('d-none');
$('.autodoc_home_modal_tags_add').removeClass('d-none');
})
@@ -191,7 +191,7 @@ $(window).bind("hashchange", function () {
function change_page() {
var args = document.location.hash.substr(1).split('_') || conf.default_hash.split('_');
var hash = args.shift();
if (!$("#autodoc_tab_" + hash).length) {
hash = conf.default_hash;
}
@@ -219,7 +219,7 @@ function change_page() {
if (conf.pageinit[hash]) {
var func = conf.pageinit[hash];
console.log(func);
if ( window[func] ) {
if (window[func]) {
window[func](args);
}
}
@@ -244,26 +244,30 @@ function page_load_home() {
function page_load_document(args) {
var [docid] = args;

if ( !docid ) { return false; }
if (!docid) { return false; }
$('.autodoc_document_empty').addClass('d-none');
$('.autodoc_document_body').removeClass('d-none');

$.getJSON(
conf.openapi + "/documents/" + docid,
function(doc) {
for(var i=0; i<doc.pageId.length; i++) {
$('.autodoc_document_carousel').append('<div><img /></div>');
$('.autodoc_document_carousel').children().last().children().attr('data-lazy',
function (doc) {
for (var i = 0; i < doc.pageId.length; i++) {
var item = $('.autodoc_document_template_carousel').clone();
$(item).children('img').attr('data-lazy',
conf.openapi + "/pages/" + doc.pageId[i] + "/image?maxWidth=100");

$(item).children('span').html(i);
$('.autodoc_document_carousel').append(item);

}
$('.autodoc_document_carousel').slick({
lazyLoad: 'ondemand',
slidesToShow: 4,
slidesToScroll: 4
});
}
);
}

Loading…
Cancel
Save