This commit is contained in:
Tony Tam
2015-06-03 22:15:00 -07:00
4 changed files with 20 additions and 12 deletions

View File

@@ -93,11 +93,13 @@ window.Docs = {
switch (fragments.length) {
case 1:
// Expand all operations for the resource and scroll to it
var dom_id = 'resource_' + fragments[0];
if (fragments[0].length > 0) { // prevent matching "#/"
// Expand all operations for the resource and scroll to it
var dom_id = 'resource_' + fragments[0];
Docs.expandEndpointListForResource(fragments[0]);
$("#"+dom_id).slideto({highlight: false});
Docs.expandEndpointListForResource(fragments[0]);
$("#"+dom_id).slideto({highlight: false});
}
break;
case 2:
// Refer to the endpoint DOM element, e.g. #words_get_search

View File

@@ -680,9 +680,11 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
}
},
toggleOperationContent: function() {
toggleOperationContent: function (event) {
var elem = $('#' + Docs.escapeResourceName(this.parentId + '_' + this.nickname + '_content'));
if (elem.is(':visible')){
event.preventDefault();
$.bbq.pushState('#/', 2);
Docs.collapseOperation(elem);
} else {
Docs.expandOperation(elem);