From 3544136ab15105f5af368384abc6ef0170701067 Mon Sep 17 00:00:00 2001 From: Josh Ponelat Date: Fri, 15 May 2015 09:10:03 +0200 Subject: [PATCH] dynamic-html: make sure clicking on return type works --- .../resources/swagger-static/assets/js/main.js | 13 ++++--------- .../resources/swagger-static/operation.mustache | 2 +- samples/dynamic-html/docs/assets/js/main.js | 13 ++++--------- samples/dynamic-html/docs/operations/PetApi.html | 16 ++++++++-------- .../dynamic-html/docs/operations/StoreApi.html | 8 ++++---- .../dynamic-html/docs/operations/UserApi.html | 16 ++++++++-------- 6 files changed, 29 insertions(+), 39 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/swagger-static/assets/js/main.js b/modules/swagger-codegen/src/main/resources/swagger-static/assets/js/main.js index 660d628567c..ee0d2f92470 100644 --- a/modules/swagger-codegen/src/main/resources/swagger-static/assets/js/main.js +++ b/modules/swagger-codegen/src/main/resources/swagger-static/assets/js/main.js @@ -1,13 +1,8 @@ -function main() {} - window.onhashchange = function() { choose(window.location.href.toString()); } -var url = 'http://motyar.blogspot.com/search?q={term}', selectionImage; - -function showModel(e, model) { -} +var selectionImage; function choose(url) { var f = url.split("/").slice(-1)[0].split("?")[0]; @@ -20,8 +15,8 @@ function choose(url) { // rebind the models $(".model a").on("click", function(e){ e.preventDefault(); - var model = $(this).parent().attr("id") - var parentOffset = $(this).parent().offset(); + var model = $(this).parent().attr("data-model") + var parentOffset = $(this).parent().offset(); var encodedWord = encodeURI(model); if(!selectionImage) { @@ -33,7 +28,7 @@ function choose(url) { $('div.model-container').append(selectionImage); } - selectionImage.load("/models/" + encodedWord + ".html") + selectionImage.load("models/" + encodedWord + ".html") selectionImage.attr('href',url.replace('{term}',encodeURI(model))).css({ left: e.pageX + 20, top: e.pageY - 10, diff --git a/modules/swagger-codegen/src/main/resources/swagger-static/operation.mustache b/modules/swagger-codegen/src/main/resources/swagger-static/operation.mustache index d0e35f1b296..e84542d1b72 100644 --- a/modules/swagger-codegen/src/main/resources/swagger-static/operation.mustache +++ b/modules/swagger-codegen/src/main/resources/swagger-static/operation.mustache @@ -13,7 +13,7 @@

HTTP Method

{{httpMethod}}

Response Type

-
{{returnType}}
+
{{returnType}}

Parameters