|
1 |
| -angular.module('openITCOCKPIT').directive('iframeDirective', function($sce){ |
| 1 | +/* |
| 2 | + * Copyright (C) <2015-present> <it-novum GmbH> |
| 3 | + * |
| 4 | + * This file is dual licensed |
| 5 | + * |
| 6 | + * 1. |
| 7 | + * This program is free software: you can redistribute it and/or modify |
| 8 | + * it under the terms of the GNU General Public License as published by |
| 9 | + * the Free Software Foundation, version 3 of the License. |
| 10 | + * |
| 11 | + * This program is distributed in the hope that it will be useful, |
| 12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | + * GNU General Public License for more details. |
| 15 | + * |
| 16 | + * You should have received a copy of the GNU General Public License |
| 17 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 | + * |
| 19 | + * 2. |
| 20 | + * If you purchased an openITCOCKPIT Enterprise Edition you can use this file |
| 21 | + * under the terms of the openITCOCKPIT Enterprise Edition license agreement. |
| 22 | + * License agreement and license key will be shipped with the order |
| 23 | + * confirmation. |
| 24 | + */ |
| 25 | + |
| 26 | +angular.module('openITCOCKPIT').directive('iframeDirective', function($sce) { |
2 | 27 | return {
|
3 | 28 | restrict: 'E',
|
4 |
| - template: '<iframe src="{{trustedUrl}}" onload="this.height=(screen.height+15);" width="100%" frameborder="0"></iframe>', |
| 29 | + template: '<iframe ng-if="trustedUrl" src="{{trustedUrl}}" onload="this.height=(screen.height+15);" width="100%" frameborder="0"></iframe>', |
5 | 30 | scope: {
|
6 | 31 | 'url': '='
|
7 | 32 | },
|
8 | 33 |
|
9 |
| - controller: function($scope){ |
| 34 | + controller: function($scope) { |
10 | 35 |
|
11 | 36 | },
|
12 | 37 |
|
13 |
| - link: function($scope, element, attr){ |
14 |
| - $scope.$watch('url', function(){ |
| 38 | + link: function($scope, element, attr) { |
| 39 | + $scope.$watch('url', function() { |
15 | 40 | $scope.trustedUrl = $sce.trustAsResourceUrl($scope.url);
|
16 | 41 | });
|
17 | 42 | }
|
|
0 commit comments