Skip to content

Commit

Permalink
Don't set the text in readonly view if it is already up2date. Partial…
Browse files Browse the repository at this point in the history
… workaround for #21
  • Loading branch information
luto committed Apr 15, 2013
1 parent 3fcab51 commit c20cb20
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions views/doc_readonly.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<pre class="doctext">Loading...</pre>

<script>
var oldexported = null;
var hash = window.location.hash;
if(hash && hash.length > 1) hash = hash.substr(1);
var activeFormat = hash || "html";
Expand All @@ -45,6 +46,9 @@ function getDocText()
var users = res.users;
var exported;
$('#users').text(users);
$('#updateerror').addClass('hidden');
if(activeFormat == "raw")
{
exported = text;
Expand All @@ -55,6 +59,11 @@ function getDocText()
exported = osfExport(parsed, activeFormat);
}
if(oldexported == exported)
return;
oldexported = exported;
$('.doctext').hide();
switch(activeFormat)
{
Expand All @@ -68,8 +77,6 @@ function getDocText()
break;
}
$('#users').text(users);
$('#updateerror').addClass('hidden');
}
)
.fail
Expand Down

0 comments on commit c20cb20

Please sign in to comment.