mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-03 18:45:26 +00:00
(js,html) Improve IMAP subscriptions manager
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
* @constructor
|
||||
* @param {object} futureAccountData
|
||||
*/
|
||||
function Account(futureAccountData, fetchAll) {
|
||||
function Account(futureAccountData) {
|
||||
// Data is immediately available
|
||||
if (typeof futureAccountData.then !== 'function') {
|
||||
angular.extend(this, futureAccountData);
|
||||
@@ -24,14 +24,6 @@
|
||||
// The promise will be unwrapped first
|
||||
//this.$unwrap(futureAccountData);
|
||||
}
|
||||
|
||||
this.fetchAll = false;
|
||||
|
||||
// Check if we're displaying the IMAP subscription management dialog
|
||||
if (angular.isDefined(fetchAll) && fetchAll) {
|
||||
this.fetchAll = true;
|
||||
this.$getMailboxes();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
clickOutsideToClose: true,
|
||||
escapeToClose: true,
|
||||
locals: {
|
||||
srcApp: vm,
|
||||
metadataForFolder: metadataForFolder,
|
||||
srcAccount: account
|
||||
}
|
||||
}).finally(function() {
|
||||
@@ -197,16 +197,25 @@
|
||||
/**
|
||||
* @ngInject
|
||||
*/
|
||||
SubscriptionsDialogController.$inject = ['$scope', '$mdDialog', 'srcApp', 'srcAccount'];
|
||||
function SubscriptionsDialogController($scope, $mdDialog, srcApp, srcAccount) {
|
||||
SubscriptionsDialogController.$inject = ['$scope', '$mdDialog', 'metadataForFolder', 'srcAccount'];
|
||||
function SubscriptionsDialogController($scope, $mdDialog, metadataForFolder, srcAccount) {
|
||||
var vm = this;
|
||||
|
||||
vm.app = srcApp;
|
||||
vm.account = new Account({id: srcAccount.id,
|
||||
name: srcAccount.name},
|
||||
true);
|
||||
vm.loading = true;
|
||||
vm.filter = { name: '' };
|
||||
vm.metadataForFolder = metadataForFolder;
|
||||
vm.account = new Account({
|
||||
id: srcAccount.id,
|
||||
name: srcAccount.name
|
||||
});
|
||||
vm.close = close;
|
||||
|
||||
|
||||
vm.account.$getMailboxes().then(function() {
|
||||
vm.loading = false;
|
||||
});
|
||||
|
||||
|
||||
function close() {
|
||||
$mdDialog.cancel();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user