Skip to content

Commit

Permalink
Don't show undefined users (bug 666704)
Browse files Browse the repository at this point in the history
  • Loading branch information
gkoberger committed Jun 23, 2011
1 parent cdb9de7 commit 0fe0a36
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions media/js/zamboni/editors.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,18 @@ function initReviewActions() {
var addon_id = $('#addon').attr('data-id');
function check_currently_viewing() {
$.post('/en-US/editors/review_viewing', {'addon_id': addon_id}, function(d){
$current = $('.currently_viewing_warning');
$current.toggle(d.is_user != 1);

var title = format(gettext('{name} was viewing this page first.'), {name: d.current_name});
$current_div = $current.filter('div');
$current_div.find('strong').remove();
$current_div.prepend($('<strong>', {'text': title}));
var show = d.is_user != 1 && typeof d.current_name != "undefined",
$current = $('.currently_viewing_warning');

$current.toggle(show);

if(show) {
var title = format(gettext('{name} was viewing this page first.'),
{name: d.current_name});
$current_div = $current.filter('div');
$current_div.find('strong').remove();
$current_div.prepend($('<strong>', {'text': title}));
}

setTimeout(check_currently_viewing, d.interval_seconds * 1000);
});
Expand Down

0 comments on commit 0fe0a36

Please sign in to comment.