Commit 34d0c083 by Rashid Khan

ensure text panel content is hidden until showdown.js is available

parent 3eb9c5de
<kibana-panel ng-controller='text' ng-init="init()"> <kibana-panel ng-controller='text' ng-init="init()">
<!--<p ng-style="panel.style" ng-bind-html-unsafe="panel.content | striphtml | newlines"></p>--> <!--<p ng-style="panel.style" ng-bind-html-unsafe="panel.content | striphtml | newlines"></p>-->
<markdown> <markdown ng-show="ready">
{{panel.content}} {{panel.content}}
</markdown> </markdown>
</kibana-panel> </kibana-panel>
\ No newline at end of file
...@@ -10,6 +10,7 @@ angular.module('kibana.text', []) ...@@ -10,6 +10,7 @@ angular.module('kibana.text', [])
_.defaults($scope.panel,_d); _.defaults($scope.panel,_d);
$scope.init = function() { $scope.init = function() {
$scope.ready = false;
} }
}).directive('markdown', function() { }).directive('markdown', function() {
...@@ -23,6 +24,7 @@ angular.module('kibana.text', []) ...@@ -23,6 +24,7 @@ angular.module('kibana.text', [])
function render_panel() { function render_panel() {
var scripts = $LAB.script("panels/text/lib/showdown.js") var scripts = $LAB.script("panels/text/lib/showdown.js")
scripts.wait(function(){ scripts.wait(function(){
scope.ready = true;
var converter = new Showdown.converter(); var converter = new Showdown.converter();
var text = scope.panel.content.replace(/&/g, '&amp;') var text = scope.panel.content.replace(/&/g, '&amp;')
.replace(/>/g, '&gt;') .replace(/>/g, '&gt;')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment