diff --git a/assets/js/controllers.js b/assets/js/controllers.js index 32bbbb7..eafad61 100644 --- a/assets/js/controllers.js +++ b/assets/js/controllers.js @@ -19,7 +19,7 @@ mailhogApp.controller('MailCtrl', function ($scope, $http, $sce, $timeout) { $scope.eventDone = 0; $scope.eventFailed = 0; - $scope.startEvent = function(name, args) { + $scope.startEvent = function(name, args, glyphicon) { var eID = guid(); console.log("Starting event '" + name + "' with id '" + eID + "'") var e = { @@ -29,6 +29,7 @@ mailhogApp.controller('MailCtrl', function ($scope, $http, $sce, $timeout) { complete: false, failed: false, args: args, + glyphicon: glyphicon, getClass: function() { // FIXME bit nasty if(this.failed) { @@ -75,7 +76,7 @@ mailhogApp.controller('MailCtrl', function ($scope, $http, $sce, $timeout) { } $scope.refresh = function() { - var e = $scope.startEvent("Loading messages"); + var e = $scope.startEvent("Loading messages", null, "glyphicon-download"); $http.get('/api/v1/messages').success(function(data) { $scope.messages = data; e.done(); @@ -89,7 +90,7 @@ mailhogApp.controller('MailCtrl', function ($scope, $http, $sce, $timeout) { reflow(); } else { $scope.preview = message; - var e = $scope.startEvent("Loading message", message.Id); + var e = $scope.startEvent("Loading message", message.Id, "glyphicon-download-alt"); $http.get('/api/v1/messages/' + message.Id).success(function(data) { $scope.cache[message.Id] = data; data.previewHTML = $sce.trustAsHtml($scope.getMessageHTML(data)); @@ -176,7 +177,7 @@ mailhogApp.controller('MailCtrl', function ($scope, $http, $sce, $timeout) { var message = $scope.releasing; $scope.releasing = null; - var e = $scope.startEvent("Releasing message", message.Id); + var e = $scope.startEvent("Releasing message", message.Id, "glyphicon-share"); $http.post('/api/v1/messages/' + message.Id + '/release', { email: $('#release-message-email').val(), @@ -202,7 +203,7 @@ mailhogApp.controller('MailCtrl', function ($scope, $http, $sce, $timeout) { $scope.deleteAllConfirm = function() { $('#confirm-delete-all').modal('hide'); - var e = $scope.startEvent("Deleting all messages"); + var e = $scope.startEvent("Deleting all messages", null, "glyphicon-remove-circle"); $http.post('/api/v1/messages/delete').success(function() { $scope.refresh(); $scope.preview = null; @@ -211,7 +212,7 @@ mailhogApp.controller('MailCtrl', function ($scope, $http, $sce, $timeout) { } $scope.deleteOne = function(message) { - var e = $scope.startEvent("Deleting message", message.Id); + var e = $scope.startEvent("Deleting message", message.Id, "glyphicon-remove"); $http.post('/api/v1/messages/' + message.Id + '/delete').success(function() { if($scope.preview._id == message._id) $scope.preview = null; $scope.refresh(); diff --git a/assets/templates/layout.html b/assets/templates/layout.html index 87aa631..1416d16 100644 --- a/assets/templates/layout.html +++ b/assets/templates/layout.html @@ -40,11 +40,18 @@ font-size: 1em; padding: 2px; margin: 0; + padding-left: 20px; } .ajax-event h2 { font-size: 0.8em; padding: 2px; margin: 0; + padding-left: 20px; + } + .ajax-event .glyphicon { + float: left; + padding: 1px; + color: #666; } /* http://stackoverflow.com/questions/18838964/add-bootstrap-glyphicon-to-input-box */ @@ -69,14 +76,6 @@ MailHog