Browse Source

more angular 1.3 upgrade fixes

Torkel Ödegaard 11 years ago
parent
commit
d70c81f03b
3 changed files with 3 additions and 4 deletions
  1. 1 1
      src/app/panels/text/module.html
  2. 2 2
      src/app/panels/text/module.js
  3. 0 1
      tasks/options/requirejs.js

+ 1 - 1
src/app/panels/text/module.html

@@ -1,4 +1,4 @@
 <div ng-controller='text' ng-init="init()" style="min-height:{{panel.height || row.height}}" ng-dblclick="openEditor()">
-  <p ng-bind-html-unsafe="content">
+  <p ng-bind-html="content">
   </p>
 </div>

+ 2 - 2
src/app/panels/text/module.js

@@ -23,7 +23,7 @@ function (angular, app, _, require) {
   var module = angular.module('grafana.panels.text', []);
   app.useModule(module);
 
-  module.controller('text', function($scope, filterSrv) {
+  module.controller('text', function($scope, filterSrv, $sce) {
 
     $scope.panelMeta = {
       description : "A static text panel that can use plain text, markdown, or (sanitized) HTML"
@@ -81,7 +81,7 @@ function (angular, app, _, require) {
 
     $scope.updateContent = function(html) {
       try {
-        $scope.content = filterSrv.applyTemplateToTarget(html);
+        $scope.content = $sce.trustAsHtml(filterSrv.applyTemplateToTarget(html));
 
         if(!$scope.$$phase) {
           $scope.$apply();

+ 0 - 1
tasks/options/requirejs.js

@@ -58,7 +58,6 @@ module.exports = function(config,grunt) {
         'angular-strap',
         'directives/all',
         'jquery.flot.pie',
-        'angular-sanitize',
         'angular-dragdrop',
       ]
     }