Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Commit

Permalink
order items on label
Browse files Browse the repository at this point in the history
Signed-off-by: Henning Treu <henning.treu@telekom.de>
  • Loading branch information
Henning Treu committed Jul 31, 2017
1 parent 4beeeac commit fcc50f1
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -83,8 +83,8 @@ angular.module('PaperUI.controllers.control', []) //
var redraw;
thingRepository.getAll(function(things) {
var thingsForTab = things.filter(function(thing) {
var location = thing.location ? thing.location.toUpperCase() : 'OTHER'
return location === tabName;
var thingLocation = thing.location ? thing.location.toUpperCase() : 'OTHER'
return thingLocation === tabName;
})
channelTypeRepository.getAll(function(channelTypes) {
angular.forEach(thingsForTab, function(thing) {
Expand All @@ -94,6 +94,9 @@ angular.module('PaperUI.controllers.control', []) //
var renderedThing = renderThing(thing, thingType, channelTypes);
if (renderedThing) {
renderedThings.push(renderedThing);
renderedThings = renderedThings.sort(function(a, b) {
return a.label < b.label ? -1 : a.label > b.label ? 1 : 0
})
$timeout.cancel(redraw)
redraw = $timeout(function() {
$scope.things.push.apply($scope.things, renderedThings);
Expand Down

0 comments on commit fcc50f1

Please sign in to comment.