(feat) ensure links in mail are opened in a blank target

This commit is contained in:
Ludovic Marcotte
2015-09-01 15:00:03 -04:00
parent 9d92318524
commit 778612bf41
2 changed files with 23 additions and 1 deletions
@@ -0,0 +1,22 @@
/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/**
* @type {angular.Module}
*/
(function () {
'use strict';
/**
* @ngInject
*/
function ensureTarget() {
return function(element) {
var tree = angular.element('<div>' + element + '</div>');
tree.find('a').attr('target', '_blank');
return angular.element('<div>').append(tree).html();
};
}
angular.module('SOGo.Common')
.filter('ensureTarget', ensureTarget);
})();