Skip to content
Snippets Groups Projects
Commit 168feace authored by alvaro's avatar alvaro
Browse files

Added preview button

parent 180f5198
No related branches found
No related tags found
No related merge requests found
......@@ -534,6 +534,7 @@ class AdminModule extends abstractModule{
<div class='bs-docs-template span9'>
<textarea class='field span12' rows='8' cols='25' id='template-editor' name='template-editor'></textarea>
<button class='btn btn-info disabled' id='template-save-button' data-url=''>Save</button>
<a href='#' id='preview-button' class='hide'><button class='btn btn-success' style='float:right;' >View component</button></a>
<div class='alert alert-success hide' id='template-msg'></div>
</div>
</div>
......
......@@ -145,8 +145,9 @@ $(document).ready(function(){
templateEditor.setValue("");
queryEditor.setValue("");
$.get(url, function(data){
$("#template-list").empty()
$("#query-list").empty()
$("#template-list").empty();
$("#query-list").empty();
$("#preview-button").attr("target", "_new").attr("href", "../"+componentName).removeClass("hide");
$.each(data.views, function(i, item){
var viewUrl = relPos+componentType+"/"+componentName+"/"+item;
var viewFileUrl = componentType+"/"+componentName+"/"+item;
......@@ -250,6 +251,7 @@ $(document).ready(function(){
$.ajax({
cache: false,
url: fileUrl,
dataType: 'text',
success: function(data){
queryEditor.setValue(data);
queryBuffer = data;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment