Browse Source

KAZOO-2626: Change add device behavior in user's devices list

4.3
Joris Tirado 12 years ago
parent
commit
82130d1a5c
2 changed files with 12 additions and 12 deletions
  1. +1
    -1
      submodules/devices/devices.js
  2. +11
    -11
      submodules/users/users.js

+ 1
- 1
submodules/devices/devices.js View File

@ -205,7 +205,7 @@ define(function(require){
data: dataModel
},
success: function(data, status) {
self.devicesRender({ deviceId: data.data.id});
callback(data.data);
}
});
},


+ 11
- 11
submodules/users/users.js View File

@ -817,23 +817,23 @@ define(function(require){
type: type,
callback: function(device) {
var rowDevice = monster.template(self, 'users-rowSpareDevice', device),
listUnassigned = template.find('.list-unassigned-items'),
countSpare = template.find('.unassigned-list-header .count-spare');
listAssigned = template.find('.list-assigned-items');
listUnassigned.find('.empty-row').hide();
listAssigned.find('.empty-row').hide();
/* reset search */
listUnassigned.find('.empty-search-row').hide();
listAssigned.find('.empty-search-row').hide();
template.find('.unassigned-list-header .search-query').val('');
listUnassigned.find('.item-row').show();
/* Update count */
countSpare.data('count', parseInt(countSpare.data('count')) + 1);
template.find('.unassigned-list-header .count-spare').html(countSpare.data('count'));
listAssigned.find('.item-row').show();
/* Add row */
listUnassigned.append(rowDevice);
listAssigned.append(rowDevice)
.find('.item-row[data-id="' + device.id + '"]')
.toggleClass('updated')
.find('button')
.removeClass('add-device btn-primary')
.addClass('remove-device btn-danger')
.text(self.i18n.active().remove);
}
});
});


Loading…
Cancel
Save