Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

change new configs to have 1 endpoint by default. change popover to f…

…ocus on editing the method
  • Loading branch information...
commit e62c0a2e6e4b9496afe49d07643a936afc9878be 1 parent f1b879d
Brandon West authored
Showing with 24 additions and 12 deletions.
  1. +2 −1  public/css/default.css
  2. +22 −11 public/js/default.js
3  public/css/default.css
View
@@ -3,7 +3,8 @@ body {
padding-bottom: 40px;
}
.sidebar-nav {
- padding: 9px 0;
+ padding: 9px 0;
+ min-height: 300px;
}
.bottom-bar {
33 public/js/default.js
View
@@ -5,11 +5,19 @@ $(function() {
//menu actuators for endpoints
$('.endpointActuator').live('click', showEndpoint);
- //tooltip for add endpoint button
- if($('.endpoint').length==0) {
- $('#addEndpoint').popover({"trigger":"manual", "content":"Get started by adding your first endpoint!", "placement":"bottom"});
- $('#addEndpoint').popover('show');
- $('body').click(hideEndpointPopover);
+ //add a new endpoint by default for new configs
+ if($('.endpoint').length==0 && $('#config').length == 1) {
+ addEndpoint(true);
+
+ firstMethod = $('#ep1 > .methods > .method');
+
+ firstMethod.popover({"trigger":"manual",
+ "title":"Edit this Method",
+ "content":"Get started by editing this method! Click on the method title bar to show the form.",
+ "placement":"bottom"});
+
+ firstMethod.popover('show');
+ $('body').click(hideMethodPopover);
}
//save file button
@@ -31,7 +39,6 @@ $(function() {
$('input.parameterName').live('change', updateParameterName);
$('.section.clickable').live('click', toggleSection);
- $('.section.clickable > span').live('click', toggleSection);
//navbar about link
$('a.about').click(showAbout);
@@ -45,8 +52,8 @@ var saveFile = function(){
$('#outputForm').submit();
}
-var hideEndpointPopover = function(e){
- $("#addEndpoint").popover('hide');
+var hideMethodPopover = function(e){
+ $('#ep1 > .methods > .method').popover('hide');
}
var showAbout = function() {
@@ -169,7 +176,7 @@ var syntaxHighlight = function(json) {
}
//TODO refactor these methods into 3 objects - endpoint, method, parameter
-var addEndpoint = function(){
+var addEndpoint = function(instant){
var endpointIndex = getEndpointIndex();
var newEndpoint = $('#endpointTemplate').children('div').first().clone();
@@ -189,8 +196,12 @@ var addEndpoint = function(){
//hide all divs
$('.endpoint').hide();
- //show the div corresponding to what was clicked
- $('#ep' + endpointIndex).show('slow');
+ if(instant==true)
+ speed='';
+ else
+ speed = 'slow';
+
+ $('#ep' + endpointIndex).show(speed);
}
var removeEndpoint = function(e) {
Please sign in to comment.
Something went wrong with that request. Please try again.