diff --git a/css/mail.css b/css/mail.css index f5db43a9f7..04213ae057 100755 --- a/css/mail.css +++ b/css/mail.css @@ -140,48 +140,6 @@ } -/* START: should be done in core/apps.css */ - -#app-navigation .collapse { - display: inline-block !important; - opacity: .3; - z-index: 1; -} - -#app-navigation-accounts { - height: calc(100% - 65px); - overflow-x: hidden; -} - -#app-navigation ul ul { - display: block; -} - -#app-navigation ul ul ul { - display: none; -} - -#app-navigation .navigation-account { - position: relative; -} -#app-navigation .navigation-account .app-navigation-entry-utils-menu-button { - /* show the account menu toggle (three dots) by default */ - display: inline-block; -} - -#app-navigation ul ul li > a { - padding-left: 32px; -} - -#app-navigation ul .collapsible.open:hover { - box-shadow: inset 0 0 3px #ddd; -} - -#app-navigation ul .collapsible.open ul { - display: block; -} -/* STOP: should be done in core/apps.css */ - #emptycontent, #mail-messages #emptycontent.emptycontent-search { position: static; @@ -194,15 +152,8 @@ } .mail-account-email { - display: inline-block; - opacity: .5; - padding: 20px 0 10px 25px; - width: calc(100% - 50px); - margin: initial; - font-size: 100%; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; + /* for icon color */ + padding-left: 44px !important; } .mail-account-email:first-child { display: none; @@ -218,22 +169,16 @@ opacity: .5; } +/* TODO to be deleted when lower suppported server + include app-navigation-entry-bullet */ .mail-account-color { - display: inline-block; + display: block; width: 14px; height: 14px; + margin: 16px; border-radius: 50%; - position: relative; - left: 15px; - top: -12px; -} -/* color dot position fix for Safari */ -@media not all and (min-resolution:.001dpcm) { @media -{ -.mail-account-color { - top: 2px; + position: absolute; } -}} .mail-message-account-color { position: absolute; @@ -242,6 +187,10 @@ z-index: 1; } +/* hide folders on unified account */ +#account-1 + .folders { + display: none; +} /* settings */ @@ -389,11 +338,6 @@ padding: 3px; } -/* override core values to work with custom html */ -#app-navigation .app-navigation-entry-utils { - top: 7px; -} - /* autocomplete list */ .ui-autocomplete .ui-menu-item a.mail-recipient-autocomplete { display: flex; diff --git a/js/routecontroller.js b/js/routecontroller.js index 04a541af31..6242e47c44 100644 --- a/js/routecontroller.js +++ b/js/routecontroller.js @@ -105,6 +105,9 @@ define(function(require) { // Show first folder of first account var firstAccount = this.accounts.at(0); var firstFolder = firstAccount.folders.at(0); + if(firstAccount.get('accountId') < 0) { + return _this.showFolder(firstAccount.get('accountId'), firstAccount.get('id'), showComposer); + } return _this.showFolder(firstAccount.get('accountId'), firstFolder.get('id'), showComposer); }, @@ -128,7 +131,7 @@ define(function(require) { if (_.isUndefined(folder)) { folder = account.folders.at(0); Radio.ui.trigger('error:show', t('mail', 'Invalid folder')); - this._navigate('accounts/' + accountId + '/folders/' + folder.get('id')); + this._navigate('accounts/' + accountId + '/folders/' + btoa(account.get('id'))); return Promise.resolve(); } return FolderController.showFolder(account, folder, !showComposer); diff --git a/js/service/accountservice.js b/js/service/accountservice.js index 46daeba26a..3b3d38af1d 100644 --- a/js/service/accountservice.js +++ b/js/service/accountservice.js @@ -86,7 +86,13 @@ define(function(require) { if (accounts.length > 1) { accounts.add({ accountId: -1, - isUnified: true + isUnified: true, + id: btoa('all-inboxes'), + name: t('mail', 'All inboxes'), + emailAddress: t('mail', 'All inboxes'), + isEmpty: false, + noSelect: false, + delimiter: '.' }, { at: 0 }); diff --git a/js/templates/account.html b/js/templates/account.html index 4c592cc6ed..c30cc0a65b 100644 --- a/js/templates/account.html +++ b/js/templates/account.html @@ -1,32 +1,35 @@ {{#if emailAddress}} -
+
{{/if}} -

{{emailAddress}}

+{{emailAddress}} {{#if hasMenu}} - - - +
+ +
+
+ +
{{/if}} -
+ {{#unless isUnifiedInbox}} {{#if hasFolders}} {{toggleCollapseMessage}} diff --git a/js/templates/folder.html b/js/templates/folder.html index 2c0cd9df16..f081c7c63e 100644 --- a/js/templates/folder.html +++ b/js/templates/folder.html @@ -1,13 +1,14 @@ -{{#if folders}} - -{{/if}} {{name}} - {{#if count}} - {{count}} - {{/if}} -
\ No newline at end of file +{{#if count}} +
+ +
+{{/if}} + \ No newline at end of file diff --git a/js/views/accountview.js b/js/views/accountview.js index d7bb000c0b..ee7e84aabf 100644 --- a/js/views/accountview.js +++ b/js/views/accountview.js @@ -19,6 +19,7 @@ define(function(require) { return Marionette.View.extend({ template: AccountTemplate, + tagName: 'li', templateContext: function() { var toggleCollapseMessage = this.collapsed ? t('mail', 'Show all folders') : t('mail', 'Collapse folders'); return { @@ -34,7 +35,8 @@ define(function(require) { 'click .app-navigation-entry-utils-menu-button button': 'toggleMenu', 'click @ui.deleteButton': 'onDelete', 'click @ui.settingsButton': 'showAccountSettings', - 'click @ui.email': 'onClick' + 'click @ui.email': 'onClick', + 'click .mail-account-color' : 'render' }, regions: { folders: '.folders' diff --git a/js/views/folderlistview.js b/js/views/folderlistview.js index 71d60252f9..bed36e19ff 100644 --- a/js/views/folderlistview.js +++ b/js/views/folderlistview.js @@ -22,7 +22,7 @@ define(function(require) { ]); var FolderListView = Marionette.CollectionView.extend({ - tagName: 'ul', + tagName: 'li', childView: FolderView, collapsed: true, initialize: function(options) { @@ -34,6 +34,13 @@ define(function(require) { } var specialRole = child.get('specialRole'); return SHOW_COLLAPSED.indexOf(specialRole) !== -1; + }, + onRender: function() { + this.$el = this.$el.children(); + // Unwrap the element to prevent infinitely + // nesting elements during re-render. + this.$el.unwrap(); + this.setElement(this.$el); } }); diff --git a/js/views/folderview.js b/js/views/folderview.js index 3704b54f21..e764d3f648 100644 --- a/js/views/folderview.js +++ b/js/views/folderview.js @@ -32,12 +32,6 @@ define(function(require) { if (this.model.get('specialRole')) { classes.push('special-' + this.model.get('specialRole')); } - if (this.model.folders.length > 0) { - classes.push('collapsible'); - } - if (this.model.get('open')) { - classes.push('open'); - } // .removeClass() does not work, https://bugs.jqueryui.com/ticket/9015 this.$el.prop('class', ''); var _this = this; diff --git a/js/views/navigation-accounts.js b/js/views/navigation-accounts.js index 916034c29e..6a2b66b181 100644 --- a/js/views/navigation-accounts.js +++ b/js/views/navigation-accounts.js @@ -23,6 +23,7 @@ define(function(require) { return Marionette.CollectionView.extend({ collection: null, childView: AccountView, + tagName: 'li', /** * @returns {undefined} */ @@ -53,6 +54,13 @@ define(function(require) { folder.set('active', true); } }, + onRender: function() { + this.$el = this.$el.children(); + // Unwrap the element to prevent infinitely + // nesting elements during re-render. + this.$el.unwrap(); + this.setElement(this.$el); + }, /** * @returns {undefined} */ diff --git a/templates/index.php b/templates/index.php index 12ab64af2b..0e78e12367 100644 --- a/templates/index.php +++ b/templates/index.php @@ -39,7 +39,7 @@
-
+