Initial integration of ngMaterial in Webmail

This commit is contained in:
Francis Lachapelle
2015-01-09 15:58:11 -05:00
parent ceca8775b5
commit 7a2bc51e77
8 changed files with 179 additions and 86 deletions

View File

@@ -191,7 +191,7 @@
selectFolder: '=sgSelectFolder'
},
template:
'<li>' +
'<md-item>' +
' <span class="folder-container">' +
' <span class="folder-content">' +
' <i class="icon icon-ion-folder"></i>' +
@@ -209,7 +209,7 @@
' </span>' +
' </span>' +
' </span>' +
'</li>' +
'</md-item>' +
'<sg-folder-tree ng-repeat="child in folder.children track by child.path"' +
' data-sg-root="root"' +
' data-sg-folder="child"' +
@@ -240,15 +240,15 @@
var list, items;
if (!scope.mode.selected) {
list = iElement.parent();
while (list[0].tagName != 'UL') {
while (list[0].tagName != 'MD-LIST') {
list = list.parent();
}
items = list.find('li');
items = list.find('md-item');
// Highlight element as "loading"
items.removeClass('_selected');
items.removeClass('_loading');
angular.element(iElement.find('li')[0]).addClass('_loading');
angular.element(iElement.find('md-item')[0]).addClass('_loading');
// Call external function
scope.selectFolder(scope.root, scope.folder);
@@ -269,14 +269,14 @@
items;
scope.mode.selected = true;
while (list[0].tagName != 'UL') {
while (list[0].tagName != 'MD-LIST') {
list = list.parent();
}
items = list.find('li');
items = list.find('md-item');
// Hightlight element as "selected"
angular.element(iElement.find('li')[0]).removeClass('_loading');
angular.element(iElement.find('li')[0]).addClass('_selected');
angular.element(iElement.find('md-item')[0]).removeClass('_loading');
angular.element(iElement.find('md-item')[0]).addClass('_selected');
// Show options button
angular.forEach(items, function(element) {

View File

@@ -0,0 +1,48 @@
/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* Angular JavaScript for common UI services */
// TODO: Normalize the namespace and prefixes
/**
* The common SOGo UI, app module
*
* @type {angular.Module}
*/
(function() {
'use strict';
angular.module('SOGo.UI', ['ngMaterial' ])
.controller('toggleCtrl', ['$scope', '$timeout', '$mdSidenav', '$log', function($scope, $timeout, $mdSidenav, $log) {
$scope.toggleLeft = function() {
$mdSidenav('left').toggle()
.then(function(){
$log.debug("toggle left is done");
});
};
$scope.toggleRight = function() {
$mdSidenav('right').toggle()
.then(function(){
$log.debug("toggle RIGHT is done");
});
};
}])
.controller('LeftCtrl', function($scope, $timeout, $mdSidenav, $log) {
$scope.close = function() {
$mdSidenav('left').close()
.then(function(){
$log.debug("close LEFT is done");
});
};
})
.controller('RightCtrl', function($scope, $timeout, $mdSidenav, $log) {
$scope.close = function() {
$mdSidenav('right').close()
.then(function(){
$log.debug("close RIGHT is done");
});
};
});
})();

View File

@@ -7,7 +7,7 @@
angular.module('SOGo.Common', []);
angular.module('SOGo.ContactsUI', []);
angular.module('SOGo.MailerUI', ['ngSanitize', 'ui.router', 'mm.foundation', 'vs-repeat', 'ck', 'ngTagsInput', 'angularFileUpload', 'SOGo.Common', 'SOGo.UICommon', 'SOGo.UIDesktop', 'SOGo.ContactsUI'])
angular.module('SOGo.MailerUI', ['ngSanitize', 'ui.router', 'mm.foundation', 'vs-repeat', 'ck', 'ngTagsInput', 'angularFileUpload', 'SOGo.Common', 'SOGo.UI', 'SOGo.UICommon', 'SOGo.UIDesktop', 'SOGo.ContactsUI'])
.constant('sgSettings', {
baseURL: ApplicationBaseURL,
@@ -62,8 +62,12 @@
})
.state('mail.account.mailbox', {
url: '/:mailboxId',
templateUrl: 'mailbox.html',
controller: 'MailboxCtrl',
views: {
'mailbox@mail': {
templateUrl: 'mailbox.html',
controller: 'MailboxCtrl'
}
},
resolve: {
stateMailbox: ['$stateParams', 'stateAccount', 'decodeUriFilter', function($stateParams, stateAccount, decodeUriFilter) {
var mailboxId = decodeUriFilter($stateParams.mailboxId);