Commit d067b69d by Torkel Ödegaard

Fixes #251, text panel change is now updating panel correctly. Changed button…

Fixes #251, text panel change is now updating panel correctly. Changed button text from Cancel to Close
parent ba928e18
...@@ -318,7 +318,7 @@ function (angular, $, kbn, moment, _) { ...@@ -318,7 +318,7 @@ function (angular, $, kbn, moment, _) {
} }
}); });
function render_panel_as_graphite_png(url) { function render_panel_as_graphite_png(url) {
url += '&width=' + elem.width(); url += '&width=' + elem.width();
url += '&height=' + elem.css('height').replace('px', ''); url += '&height=' + elem.css('height').replace('px', '');
url += '&bgcolor=1f1f1f'; // @grayDarker & @kibanaPanelBackground url += '&bgcolor=1f1f1f'; // @grayDarker & @kibanaPanelBackground
......
...@@ -73,7 +73,7 @@ function (angular, $, _) { ...@@ -73,7 +73,7 @@ function (angular, $, _) {
elem.removeClass("ng-cloak"); elem.removeClass("ng-cloak");
} }
newScope.$on('$destroy',function(){ newScope.$on('$destroy',function() {
elem.unbind(); elem.unbind();
elem.remove(); elem.remove();
}); });
......
...@@ -8,9 +8,11 @@ ...@@ -8,9 +8,11 @@
</div> </div>
</div> </div>
<label class=small>Content <label class=small>Content
<span ng-show="panel.mode == 'html'">(This area uses HTML sanitized via AngularJS's <a href='http://docs.angularjs.org/api/ngSanitize.$sanitize'>$sanitize</a> service)</span> <span ng-show="panel.mode == 'html'">(This area uses HTML sanitized via AngularJS's <a href='http://docs.angularjs.org/api/ngSanitize.$sanitize'>$sanitize</a> service)</span>
<span ng-show="panel.mode == 'markdown'">(This area uses <a target="_blank" href="http://en.wikipedia.org/wiki/Markdown">Markdown</a>. HTML is not supported)</span> <span ng-show="panel.mode == 'markdown'">(This area uses <a target="_blank" href="http://en.wikipedia.org/wiki/Markdown">Markdown</a>. HTML is not supported)</span>
</label> </label>
<textarea ng-model="panel.content" rows="6" style="width:95%"></textarea>
<textarea ng-model="panel.content" rows="6" style="width:95%" ng-change="render()" ng-model-onblur>
</textarea>
</div> </div>
\ No newline at end of file
<div ng-controller='text' ng-init="init()"> <div ng-controller='text' ng-init="init()" style="min-height:{{panel.height || row.height}}">
<!--<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 ng-show="ready && panel.mode == 'markdown'"> <markdown ng-show="ready && panel.mode == 'markdown'">
{{panel.content}} {{panel.content}}
......
...@@ -48,6 +48,10 @@ function (angular, app, _, require) { ...@@ -48,6 +48,10 @@ function (angular, app, _, require) {
$scope.ready = false; $scope.ready = false;
}; };
$scope.render = function() {
$scope.$emit('render');
};
}); });
module.directive('markdown', function() { module.directive('markdown', function() {
......
...@@ -156,5 +156,5 @@ ...@@ -156,5 +156,5 @@
</div> </div>
<button ng-click="add_row(dashboard.current,row); reset_row();" class="btn btn-success" ng-show="editor.index == 1">Create Row</button> <button ng-click="add_row(dashboard.current,row); reset_row();" class="btn btn-success" ng-show="editor.index == 1">Create Row</button>
<button type="button" class="btn btn-danger" ng-click="editor.index=0;dismiss();reset_panel();dashboard.refresh()">Close</button> <button type="button" class="btn btn-info" ng-click="editor.index=0;dismiss();reset_panel();dashboard.refresh()">Close</button>
</div> </div>
\ No newline at end of file
...@@ -19,5 +19,5 @@ ...@@ -19,5 +19,5 @@
<div class="modal-footer"> <div class="modal-footer">
<!-- close_edit() is provided here to allow for a scope to perform action on dismiss --> <!-- close_edit() is provided here to allow for a scope to perform action on dismiss -->
<button type="button" class="btn btn-danger" ng-click="editor.index=0;dismiss()">Cancel</button> <button type="button" class="btn btn-info" ng-click="editor.index=0;dismiss()">Close</button>
</div> </div>
\ No newline at end of file
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