Change the cbi.js code to create a div based button element instead of an
image button.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit
875b561875cb4eca4c913c69ce2dfd21265b6ac6)
t.placeholder = holder;
}
- var b = document.createElement('img');
- b.src = cbi_strings.path.resource + ((i+1) < values.length ? '/cbi/remove.gif' : '/cbi/add.gif');
- b.className = 'cbi-image-button';
+ var b = E('div', {
+ class: 'cbi-button cbi-button-' + ((i+1) < values.length ? 'remove' : 'add')
+ }, (i+1) < values.length ? '×' : '+');
parent.appendChild(t);
parent.appendChild(b);
input = input.previousSibling;
}
- if (se.src.indexOf('remove') > -1)
- {
+ if (se.classList.contains('cbi-button-remove')) {
input.value = '';
cbi_dynlist_keydown({
keyCode: 8
});
}
- else
- {
+ else {
cbi_dynlist_keydown({
target: input,
keyCode: 13