Skip to content

Commit

Permalink
fix for #261
Browse files Browse the repository at this point in the history
  • Loading branch information
fehguy committed Jul 17, 2013
1 parent f4d77d7 commit e72dbd6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
13 changes: 2 additions & 11 deletions dist/swagger-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -1775,7 +1775,7 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
};

OperationView.prototype.submitOperation = function(e) {
var error_free, form, map, o, opts, _i, _j, _len, _len1, _ref, _ref1;
var error_free, form, map, o, opts, _i, _len, _ref;
if (e != null) {
e.preventDefault();
}
Expand All @@ -1799,22 +1799,13 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
opts = {
parent: this
};
_ref = form.serializeArray();
_ref = form.find(".body-textarea,.parameter");
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
o = _ref[_i];
if ((o.value != null) && jQuery.trim(o.value).length > 0) {
map[o.name] = o.value;
}
}
_ref1 = form.find(".body-textarea,.parameter");
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
o = _ref1[_j];
if ((o.value != null) && jQuery.trim(o.value).length > 0) {
console.log(o.name + ", " + o.value);
map[o.name] = encodeURI(o.value);
}
}
console.log(map);
opts.responseContentType = $("div select[name=responseContentType]", $(this.el)).val();
opts.requestContentType = $("div select[name=parameterContentType]", $(this.el)).val();
return this.model["do"](map, opts, this.showCompleteStatus, this.showErrorStatus, this);
Expand Down
2 changes: 1 addition & 1 deletion dist/swagger-ui.min.js

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions src/main/coffeescript/view/OperationView.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,14 @@ class OperationView extends Backbone.View
if error_free
map = {}
opts = {parent: @}
for o in form.serializeArray()
if(o.value? && jQuery.trim(o.value).length > 0)
map[o.name] = o.value
#for o in form.serializeArray()
#if(o.value? && jQuery.trim(o.value).length > 0)
#map[o.name] = o.value

for o in form.find(".body-textarea,.parameter")
if(o.value? && jQuery.trim(o.value).length > 0)
console.log o.name + ", " + o.value
map[o.name] = encodeURI(o.value)

console.log map

opts.responseContentType = $("div select[name=responseContentType]", $(@el)).val()
opts.requestContentType = $("div select[name=parameterContentType]", $(@el)).val()

Expand Down

0 comments on commit e72dbd6

Please sign in to comment.