mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-30 17:29:37 +00:00
Initial integration of ngMaterial in Webmail
This commit is contained in:
@@ -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) {
|
||||
|
||||
48
UI/WebServerResources/js/Common/ui.js
Normal file
48
UI/WebServerResources/js/Common/ui.js
Normal 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");
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user