mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-29 05:42:20 +00:00
edit js/ditto
This commit is contained in:
parent
34c2602c12
commit
2f02775098
15
js/ditto.js
15
js/ditto.js
@ -33,14 +33,6 @@ function initialize() {
|
|||||||
init_edit_button();
|
init_edit_button();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 初始化内容数组
|
|
||||||
var menuOL = $(ditto.sidebar_id+' ol');
|
|
||||||
menuOL.attr('start',0);
|
|
||||||
|
|
||||||
menuOL.find('li').map(function(){
|
|
||||||
menu.push(this.href);
|
|
||||||
});
|
|
||||||
|
|
||||||
// page router
|
// page router
|
||||||
router();
|
router();
|
||||||
$(window).on('hashchange', router);
|
$(window).on('hashchange', router);
|
||||||
@ -49,6 +41,13 @@ function initialize() {
|
|||||||
function init_sidebar_section() {
|
function init_sidebar_section() {
|
||||||
$.get(ditto.sidebar_file, function(data) {
|
$.get(ditto.sidebar_file, function(data) {
|
||||||
$(ditto.sidebar_id).html(marked(data));
|
$(ditto.sidebar_id).html(marked(data));
|
||||||
|
// 初始化内容数组
|
||||||
|
var menuOL = $(ditto.sidebar_id+' ol');
|
||||||
|
menuOL.attr('start',0);
|
||||||
|
|
||||||
|
menuOL.find('li').map(function(){
|
||||||
|
menu.push(this.href);
|
||||||
|
});
|
||||||
}, "text").fail(function() {
|
}, "text").fail(function() {
|
||||||
alert("Opps! can't find the sidebar file to display!");
|
alert("Opps! can't find the sidebar file to display!");
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user