diff --git a/src/popup/app/config.js b/src/popup/app/config.js index 4948dddbee..0a3e36c79a 100644 --- a/src/popup/app/config.js +++ b/src/popup/app/config.js @@ -89,7 +89,7 @@ templateUrl: "app/vault/views/vaultAddSite.html", controller: 'vaultAddSiteController', data: { authorize: true }, - params: { animation: null, returnScrollY: 0, returnSearchText: null } + params: { animation: null, returnScrollY: 0, returnSearchText: null, name: null, uri: null } }) .state('editSite', { url: "/edit-site?siteId", diff --git a/src/popup/app/current/currentController.js b/src/popup/app/current/currentController.js index 6bf8fc179b..7dd0c89108 100644 --- a/src/popup/app/current/currentController.js +++ b/src/popup/app/current/currentController.js @@ -1,13 +1,15 @@ angular .module('bit.current') - .controller('currentController', function ($scope, siteService, cipherService, tldjs, toastr, $q, $window) { + .controller('currentController', function ($scope, siteService, cipherService, tldjs, toastr, $q, $window, $state) { var pageDetails = null, - tabId = null; + tabId = null, + url = null, + domain = null; + $scope.canAutofill = false; chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) { - var url = null; if (tabs.length > 0) { url = tabs[0].url; tabId = tabs[0].id; @@ -16,7 +18,7 @@ angular return; } - var domain = tldjs.getDomain(url); + domain = tldjs.getDomain(url); $scope.sites = []; if (!domain) { return; @@ -85,6 +87,14 @@ angular }); }); + $scope.addSite = function () { + $state.go('addSite', { + animation: 'in-slide-up', + name: domain, + uri: url + }); + }; + $scope.fillSite = function (site) { var fillScript = null; if (site && $scope.canAutofill && pageDetails) { diff --git a/src/popup/app/current/views/current.html b/src/popup/app/current/views/current.html index d85b154ab8..0e52c536a0 100644 --- a/src/popup/app/current/views/current.html +++ b/src/popup/app/current/views/current.html @@ -1,4 +1,7 @@