Browse Source

docid over anchor

master
Pascal Gloor 5 years ago
parent
commit
d069740fa4
1 changed files with 6 additions and 7 deletions
  1. 6
    7
      www/js/autodoc.js

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

}); });


function change_page() { function change_page() {
var hash = document.location.hash.substr(1) || conf.default_hash;

var args = document.location.hash.substr(1).split('_') || conf.default_hash.split('_');
var hash = anchor.shift();
if (!$("#autodoc_tab_" + hash).length) { if (!$("#autodoc_tab_" + hash).length) {
hash = conf.default_hash; hash = conf.default_hash;
} }
}); });


if (conf.pageinit[hash]) { if (conf.pageinit[hash]) {
eval(conf.pageinit[hash]);
eval(conf.pageinit[hash](args));
} }
} }


document_load(); document_load();
} }


function page_load_document() {
var docid = $('#autodoc_tab_document').data('docid');
function page_load_document(docid) {
console.log(docid); console.log(docid);
if ( !docid ) { if ( !docid ) {
return false; return false;
); );
$(col).find(".autodoc_template_home_img").data("documentId", doc.id); $(col).find(".autodoc_template_home_img").data("documentId", doc.id);
$(col).find(".autodoc_template_home_img").on('click', function (e) { $(col).find(".autodoc_template_home_img").on('click', function (e) {
$('#autodoc_tab_document').data('docid', $(e.target).data("documentId"));
window.location.hash = 'document';
window.location.hash = 'document_' + $(e.target).data("documentId");
e.preventDefault(); e.preventDefault();
// home_modal_open($(e.target).data("documentId")); // home_modal_open($(e.target).data("documentId"));
}); });

Loading…
Cancel
Save