Permalink
Browse files

updating parameter name is now reflected in the parameter container l…

…abel
  • Loading branch information...
brandonmwest committed Mar 30, 2012
1 parent 9063e57 commit b88f4ccf07b736e4ff4c9b17a950f8809fee769c
Showing with 12 additions and 4 deletions.
  1. +6 −0 public/js/default.js
  2. +3 −2 views/_parameters.haml
  3. +3 −2 views/_templates.haml
View
@@ -22,6 +22,7 @@ $(function() {
$('input.endpointName').live('change', updateEndpointName);
$('input.methodName').live('change', updateMethodName);
+ $('input.parameterName').live('change', updateParameterName);
$('.section.clickable').live('click', toggleSection);
@@ -104,6 +105,11 @@ var updateMethodName = function(e) {
menuItem.html($(e.target).val());
}
+var updateParameterName = function(e){
+ var span = $(e.target).closest('.parameter').find('.parameterNameSpan')
+ span.html($(e.target).val());;
+}
+
//from http://stackoverflow.com/questions/4810841/json-pretty-print-using-javascript
var syntaxHighlight = function(json) {
json = json.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
View
@@ -6,7 +6,8 @@
%li.parameter{:endpointIndex => endpointIndex, :methodIndex => methodIndex, :parameterIndex => param_count}
%legend
.section.clickable{"parent" => "#endpoint#{endpointIndex}method#{methodIndex}", "target" => "#endpoint#{endpointIndex}method#{methodIndex}parameter#{param_count}"}
- Parameter: #{p.Name}
+ Parameter:
+ %span.parameterNameSpan #{p.Name}
.parameterContainer.hide{:id => "endpoint#{endpointIndex}method#{methodIndex}parameter#{param_count}"}
%span.method-controls
@@ -15,7 +16,7 @@
.control-group
%label.control-label{:for => "endpoints[#{endpointIndex}].methods[#{methodIndex}].parameters[#{param_count}].ParameterName"} Parameter Name
.controls
- %input{:name => "endpoints[#{endpointIndex}].methods[#{methodIndex}].parameters[#{param_count}].ParameterName", |
+ %input.parameterName{:name => "endpoints[#{endpointIndex}].methods[#{methodIndex}].parameters[#{param_count}].ParameterName", |
:id => "endpoints[#{endpointIndex}].methods[#{methodIndex}].parameters[#{param_count}].ParameterName", |
:value => "#{p.Name}"} |
.control-group
View
@@ -71,7 +71,8 @@
%li.parameter
%legend
.section.clickable{"target" => "#endpoint!endpoint!method!method!parameter!parameter!"}
- Parameter: New Parameter
+ Parameter:
+ %span.parameterNameSpan New Parameter
.parameterContainer.hide{:id => "endpoint!endpoint!method!method!parameter!parameter!"}
%span.method-controls
@@ -80,7 +81,7 @@
.control-group
%label.control-label{:for => "endpoints[!endpoint!].methods[!method!].parameters[!parameter!].ParameterName"} Parameter Name
.controls
- %input{:name => "endpoints[!endpoint!].methods[!method!].parameters[!parameter!].ParameterName", |
+ %input.parameterName{:name => "endpoints[!endpoint!].methods[!method!].parameters[!parameter!].ParameterName", |
:id => "endpoints[!endpoint!].methods[!method!].parameters[!parameter!].ParameterName", |
:value => "New Parameter"}
.control-group

0 comments on commit b88f4cc

Please sign in to comment.