diff --git a/js/modules/main/src/controllers/itemPreviewCtrl.js b/js/modules/main/src/controllers/itemPreviewCtrl.js index b2bc472c..590762ad 100644 --- a/js/modules/main/src/controllers/itemPreviewCtrl.js +++ b/js/modules/main/src/controllers/itemPreviewCtrl.js @@ -1,7 +1,9 @@ -var ItemPreviewCtrl = function($state, $scope, itemTypeMap, mjs, item, langManager) { +var ItemPreviewCtrl = function($state, $scope, $location, $rootScope, itemTypeMap, mjs, item, langManager) { var self = this; this.$state = $state; + this.$rootScope = $rootScope; + this.$location = $location; this.mjs = mjs; this.$scope = $scope; this.item = item; @@ -16,6 +18,10 @@ var ItemPreviewCtrl = function($state, $scope, itemTypeMap, mjs, item, langManag ItemPreviewCtrl.prototype = { + saveCurrentSearchUrl: function(){ + this.$rootScope.lastSearchUrl = this.$location.url(); + }, + get_item_url: function(item_data) { // TODO: refactor to user item.get_url if (this.url !== undefined) { @@ -67,4 +73,4 @@ ItemPreviewCtrl.prototype = { }; -angular.module('main').controller('ItemPreviewCtrl', ['$state', '$scope', 'itemTypeMap', 'mjs', 'item', 'langManager', ItemPreviewCtrl]); +angular.module('main').controller('ItemPreviewCtrl', ['$state', '$scope', '$location', '$rootScope', 'itemTypeMap', 'mjs', 'item', 'langManager', ItemPreviewCtrl]); diff --git a/js/modules/main/src/controllers/personViewController.js b/js/modules/main/src/controllers/personViewController.js index 40cd3bfe..ee3e476a 100644 --- a/js/modules/main/src/controllers/personViewController.js +++ b/js/modules/main/src/controllers/personViewController.js @@ -71,6 +71,11 @@ var PersonViewController = function ($http, $window, $document, $rootScope, self.load(toParams); } }); + + $scope.backToLastSearch = function() { + $location.path($rootScope.lastSearchUrl); + $rootScope.lastSearchUrl = null; + }; document.documentElement.addEventListener('mouseup', function (e) { self.mouseUp(e) diff --git a/templates/main/ftrees/person.html b/templates/main/ftrees/person.html index c4dc0ebd..648d20c8 100644 --- a/templates/main/ftrees/person.html +++ b/templates/main/ftrees/person.html @@ -23,7 +23,7 @@

-
+

Exit Tree diff --git a/templates/main/item-preview.html b/templates/main/item-preview.html index 9ac7191e..3f0f6144 100644 --- a/templates/main/item-preview.html +++ b/templates/main/item-preview.html @@ -1,6 +1,6 @@