14 |
var item = $('#item'+id); |
var item = $('#item'+id); |
15 |
|
|
16 |
if ( item.length > 0 ) { |
if ( item.length > 0 ) { |
17 |
console.error('element', id, 'allready exists', item); |
console.warn('element', id, 'allready exists', item); |
18 |
item.addClass('in_range'); |
item.addClass('in_range'); |
19 |
} else { |
} else { |
20 |
var tabindex = update_selected(+1) + 1; |
var tabindex = update_selected(+1) + 1; |
33 |
|
|
34 |
item.click( function() { |
item.click( function() { |
35 |
// remove selected item |
// remove selected item |
36 |
this.fadeOut('slow', function() { |
item.fadeOut('slow', function() { |
37 |
console.debug('remove',id); |
console.debug('remove',id); |
38 |
update_selection( -1 ); |
item.remove(); |
39 |
this.remove(); |
var selected = update_selected( -1 ); |
40 |
|
console.info('selected', selected); |
41 |
}); |
}); |
42 |
}); |
}); |
43 |
}, |
}, |
44 |
error: function (XMLHttpRequest, textStatus, errorThrown) { |
error: function (XMLHttpRequest, textStatus, errorThrown) { |
45 |
|
console.error( textStatus ); |
46 |
item.replace('Error loading: ' + testStatus); |
item.replace('Error loading: ' + testStatus); |
47 |
item.removeClass('loading'); |
item.removeClass('loading'); |
48 |
} |
} |
83 |
} else if ( a[0] == 'removed' ) { |
} else if ( a[0] == 'removed' ) { |
84 |
remove_tag( a[1] ); |
remove_tag( a[1] ); |
85 |
} else { |
} else { |
86 |
console.error( 'unknown', cmd, id ); |
console.error( 'unknown', a ); |
87 |
} |
} |
88 |
}; |
}; |
89 |
|
|