Skip to content

Commit

Permalink
set some attributes after the page finished rendering
Browse files Browse the repository at this point in the history
makes it possible to save the page.
  • Loading branch information
dtinth committed Mar 10, 2012
1 parent 3b8e57f commit 49c18c1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions js/core/loader.js
Expand Up @@ -8,6 +8,10 @@

// when all scripts are loaded, load page from url and display
DtWiki.hook('load', function(next) {
if ($('#km-content').attr('data-noload') == 'true') {
document.title = $('#km-content').attr('data-title');
return next();
}
var m = location.search.match(/^\??(.+)/);
if (m) {
var url = m[1];
Expand Down Expand Up @@ -81,6 +85,7 @@ DtWiki.displayError = function(message) {
DtWiki.hook('display', function(next) {
$('#km-content').html(this.html);
document.title = $('#km-content h1').text();
$('#km-content').attr('data-title', document.title).attr('data-noload', 'true');
next();
});

Expand Down

0 comments on commit 49c18c1

Please sign in to comment.