Skip to content

Commit 927a74d

Browse files
author
Nuo Yan
committed
added the new JSON editor
1 parent 53f9cf0 commit 927a74d

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

chef-server-webui/app/views/databag_items/_form.html.haml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
.inner
33
%div.group.form
44
%label.label Data
5-
%div.editor
6-
%div#tree
7-
%div#jform
8-
%div.clear
9-
%script= "$(document).ready(function() { JSONeditor.start('tree', 'jform', #{@default_data.to_json} , false); });"
5+
%div.group.form{:style => "position:relative;"}
6+
%label.label Attributes
7+
= partial '../layout/jsonedit', :json =>@default_data.to_json
8+
109

1110
= form(:action => form_url, :method => :post, :id => form_id, :class => 'form') do
1211
%div.group

chef-server-webui/public/javascripts/chef.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ $(document).ready(function(){
5656
form.append('<input type="hidden" name="_method" value="put">');
5757
}
5858
form.append('<input type="hidden" id="json_data" name="json_data"/>');
59-
form.append($('input#json_data').attr('value', JSONeditor.treeBuilder.JSONstring.make(JSONeditor.treeBuilder.json)))
59+
form.append($('input#json_data').attr('value', BCJTEP.save()));
6060
});
6161

6262
$('form#edit_databag, form#create_databag').submit(function(event) {

0 commit comments

Comments
 (0)