Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

method menu items now work correctly when removing endpoints

  • Loading branch information...
commit 0042f35dc688c41195fc568cee4e140860e96a4a 1 parent 0f36acf
@brandonmwest authored
View
12 public/js/default.js
@@ -192,7 +192,6 @@ var initializeEndpoint = function(endpoint){
//This is a bad function name. Rename.
var updateEndpoint = function(endpoint, newId, oldId) {
-
if(typeof(oldId) != 'undefined')
placeholder = oldId;
else
@@ -218,6 +217,9 @@ var updateEndpoint = function(endpoint, newId, oldId) {
}
});
+ //method menu items are not being updated when endpoints are being removed
+
+
return endpoint;
}
@@ -232,7 +234,15 @@ var updateEndpointMenuItem = function(menuItem, newId, oldId) {
if(link.text().length == 0)
link.text("New Endpoint");
+
+ //update all the child menuitems
+ var children = menuItem.find('.methodActuator');
+ for(i=0; i<children.length; i++) {
+ child = $(children[i]).closest('li');
+ updateMethodMenuItem(child, newId, i+1)
+ }
+
return menuItem;
}
View
4 views/_methods.haml
@@ -7,8 +7,8 @@
%legend
.section.clickable{"target" => "#endpoint#{endpointIndex}method#{method_count}"}
%a{:name => "endpoint#{endpointIndex}method#{method_count}"}
- Method:
- %span.methodNameSpan #{m.MethodName}
+ Method:
+ %span.methodNameSpan #{m.MethodName}
.methodContainer.hide{:id => "endpoint#{endpointIndex}method#{method_count}"}
%span.method-controls
View
6 views/_templates.haml
@@ -19,9 +19,9 @@
%legend
.section.clickable{"target" => "#endpoint!endpoint!method!method!"}
%a{:name => "endpoint!endpoint!method!method!"}
- Method:
- %span.methodNameSpan
- New Method
+ Method:
+ %span.methodNameSpan
+ New Method
.methodContainer.hide{:id => "endpoint[!endpoint!]method[!method!]"}
.control-group
Please sign in to comment.
Something went wrong with that request. Please try again.