/* eslint-disable no-param-reassign eslint-disable no-undef */
/* global I18n zebraPrint */
(function() {
var zebraPrinter;
function initZebraPrinterList() {
var zebraContainer = $('.zebra-printers');
zebraPrinter = zebraPrint.init(
zebraContainer,
{
clearSelectorOnFirstDevice: true,
noDevices: function() {
zebraContainer.empty();
zebraContainer.append(`
${I18n.t('users.settings.account.label_printer.no_printers_available')}`);
},
appendDevice: function(device) {
zebraContainer.append(`${device.name}
${device.status}`);
},
beforeRefresh: function() {
zebraContainer.empty();
zebraContainer.append(`
${I18n.t('users.settings.account.label_printer.looking_for_printers')}
`);
}
},
true
);
}
$('.zebra-printer-refresh').on('click', function() {
zebraPrinter.refreshList();
});
initZebraPrinterList();
}());