diff --git a/submodules/users/users.js b/submodules/users/users.js index d1eaff1..f2a9a26 100644 --- a/submodules/users/users.js +++ b/submodules/users/users.js @@ -206,6 +206,8 @@ define(function(require){ template.find('.user-rows').append(templateUser); }); + template.find('[data-toggle="tooltip"]').tooltip(); + self.usersBindEvents(template, parent, dataTemplate); parent @@ -422,10 +424,22 @@ define(function(require){ if(userId in mapUsers) { if(mapUsers[userId].extra.devices.length == 2) { - mapUsers[userId].extra.additionalDevices++; + if(mapUsers[userId].extra.additionalDevices) { + mapUsers[userId].extra.additionalDevices.count++; + mapUsers[userId].extra.additionalDevices.tooltip += '
'+device.name + ' (' + device.device_type.replace('_', ' ') + ')'; + } else { + mapUsers[userId].extra.additionalDevices = { + count: 1, + tooltip: device.name + ' (' + device.device_type.replace('_', ' ') + ')' + }; + } } else { - mapUsers[userId].extra.devices.push(device.device_type); + console.log(device); + mapUsers[userId].extra.devices.push({ + name: device.name + ' (' + device.device_type.replace('_', ' ') + ')', + type: device.device_type + }); } } }); @@ -510,12 +524,12 @@ define(function(require){ self.usersRemoveOverlay(); cell.css({ - 'position': 'inline-block', + 'position': 'initial', 'z-index': '0' }); cell.parent().siblings('.edit-user').css({ - 'position': 'block', + 'position': 'initial', 'z-index': '0' }); } diff --git a/views/users-row.html b/views/users-row.html index 9377d37..91a3998 100644 --- a/views/users-row.html +++ b/views/users-row.html @@ -25,33 +25,33 @@
{{#each extra.devices}} - {{#compare this '===' 'softphone'}} - + {{#compare this.type '===' 'softphone'}} + {{/compare}} - {{#compare this '===' 'cellphone'}} - + {{#compare this.type '===' 'cellphone'}} + {{/compare}} - {{#compare this '===' 'smartphone'}} - + {{#compare this.type '===' 'smartphone'}} + {{/compare}} - {{#compare this '===' 'mobile'}} - + {{#compare this.type '===' 'mobile'}} + {{/compare}} - {{#compare this '===' 'sip_device'}} - + {{#compare this.type '===' 'sip_device'}} + {{/compare}} - {{#compare this '===' 'fax'}} - + {{#compare this.type '===' 'fax'}} + {{/compare}} - {{#compare this '===' 'landline'}} - + {{#compare this.type '===' 'landline'}} + {{/compare}} {{else}} {{ i18n.users.noUserDevices }} {{/each}} {{#if extra.additionalDevices}} - (+{{extra.additionalDevices}}) + (+{{extra.additionalDevices.count}}) {{/if}}
" 5}} smaller{{/compare}}" data-type="features">