From 4b51ff9c8428d459fd45801050e728982b5eb89f Mon Sep 17 00:00:00 2001 From: Peter Deltchev Date: Tue, 5 Jan 2016 11:18:58 -0800 Subject: [PATCH] #20: Tweaked the genre merging UI to be less tedious. --- public/templates/admin/genres.html | 6 +++--- .../scripts/app/controllers/admin-genres.coffee | 11 +++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/public/templates/admin/genres.html b/public/templates/admin/genres.html index 3f3b82da..acb709e5 100644 --- a/public/templates/admin/genres.html +++ b/public/templates/admin/genres.html @@ -24,9 +24,9 @@ {{ genre.track_count }} - - - + + + diff --git a/resources/assets/scripts/app/controllers/admin-genres.coffee b/resources/assets/scripts/app/controllers/admin-genres.coffee index 7242b5e1..4893ecc0 100644 --- a/resources/assets/scripts/app/controllers/admin-genres.coffee +++ b/resources/assets/scripts/app/controllers/admin-genres.coffee @@ -50,17 +50,16 @@ angular.module('ponyfm').controller 'admin-genres', [ genre.isSaving = false - $scope.startMerge = (genreToDelete) -> - $scope.genreToDelete = genreToDelete + $scope.startMerge = (destinationGenre) -> + $scope.destinationGenre = destinationGenre $scope.mergeInProgress = true $scope.cancelMerge = () -> - $scope.genreToDelete = null + $scope.destinationGenre = null $scope.mergeInProgress = false - $scope.finishMerge = (destinationGenre) -> - $scope.mergeInProgress = false - genres.merge($scope.genreToDelete.id, destinationGenre.id) + $scope.finishMerge = (genreToDelete) -> + genres.merge(genreToDelete.id, $scope.destinationGenre.id) .done (response) -> loadGenres() ]