Skip to content

Instantly share code, notes, and snippets.

@documentcloud
Created December 16, 2009 18:19
Show Gist options
  • Select an option

  • Save documentcloud/258038 to your computer and use it in GitHub Desktop.

Select an option

Save documentcloud/258038 to your computer and use it in GitHub Desktop.
updateNavigation : function(sections) {
DV.Schema.data.chapters = [];
_.each(sections, function(sec) {
sec.id = _.uniqueId();
sec.pages = '' + sec.start_page + '-' + sec.end_page;
_.each(_.range(sec.start_page-1, sec.end_page), function(i){
DV.Schema.data.chapters[i] = sec.id;
});
});
DV.controller.models.chapters.chapters = DV.Schema.data.chapters;
DV.Schema.data.sections = sections;
$('#DV-navigationBolds', document.head).remove();
DV.controller.helpers.renderNavigation();
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment