discogs_importer: improve debug_color() output

This commit is contained in:
Laurent Monin 2015-06-12 15:08:12 +02:00
parent bce2b544d5
commit a9695a21ca

View file

@ -112,7 +112,7 @@ function insertMBLinks($root) {
$root = $('body'); $root = $('body');
} }
function debug_color(what, n) { function debug_color(what, n, id) {
var colors = [ var colors = [
'#B3C6FF', '#B3C6FF',
'#C6B3FF', '#C6B3FF',
@ -131,10 +131,11 @@ function insertMBLinks($root) {
if (DEBUG) { if (DEBUG) {
$(what).css('border', '2px dotted ' + colors[n%colors.length]); $(what).css('border', '2px dotted ' + colors[n%colors.length]);
var debug_attr = $(what).attr('debug_discogs'); var debug_attr = $(what).attr('debug_discogs');
if (!id) id = '';
if (debug_attr) { if (debug_attr) {
$(what).attr('debug_discogs', debug_attr + ',' + n); $(what).attr('debug_discogs', debug_attr + ' || ' + id + '(' + n + ')');
} else { } else {
$(what).attr('debug_discogs', n); $(what).attr('debug_discogs', id + '(' + n + ')');
} }
} }
} }