Skip to content

Commit

Permalink
Using JSON result in locktimer.refreshed
Browse files Browse the repository at this point in the history
As the ajax_lock now returns a JSON result, it needs to be
parsed and evaluated.

Signed-off-by: Johannes Thönes <johannes.thoenes@googlemail.com>
  • Loading branch information
Lukasz Burdzanowski and Johannes Thönes authored and Johannes Thönes committed Apr 25, 2011
1 parent 87dd194 commit cf43482
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/scripts/locktimer.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ var locktimer = {
refreshed: function(){
var data = this.response;
var error = data.charAt(0);
data = data.substring(1);
data = JSON.parse(data.substring(1));

$('draft__status').innerHTML=data;
if(data.draft_message){
$('draft__status').innerHTML=data.draft_message;
}
if(error != '1') return; // locking failed
locktimer.reset();
}
Expand Down

0 comments on commit cf43482

Please sign in to comment.