Commit 70565c4b authored by Aron Carroll's avatar Aron Carroll Committed by Randall Leeds

Fix the Account menu item

Moved the event handling logic into the AccountManagement controller
parent 14f239a9
......@@ -10,9 +10,6 @@ imports = [
class App
scope:
accountManagement: {show: false} # TODO: Refactor this out.
this.$inject = [
'$element', '$location', '$q', '$rootScope', '$route', '$scope', '$timeout',
'annotator', 'flash', 'identity', 'queryparser', 'socket',
......@@ -352,9 +349,6 @@ class App
filter = streamfilter.getFilter()
sock.send(JSON.stringify({filter}))
$scope.$on 'nav:account', ->
$scope.accountManagement.show = true
$rootScope.viewState =
sort: ''
view: 'Screen'
......
class AccountManagement
@inject = ['$scope, $filter', 'flash', 'profile', 'util']
@inject = ['$scope', '$rootScope', '$filter', 'flash', 'profile', 'util']
constructor: ($scope, $filter, flash, profile, util) ->
constructor: ($scope, $rootScope, $filter, flash, profile, util) ->
persona_filter = $filter('persona')
onSuccess = (response) ->
......@@ -48,5 +48,8 @@ class AccountManagement
promise = profile.edit_profile(packet)
promise.$promise.then(onSuccess, angular.bind(null, onError, form))
$rootScope.$on 'nav:account', ->
$scope.$apply -> $scope.sheet = true
angular.module('h.controllers.AccountManagement', [])
.controller('AccountManagement', AccountManagement)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment