Merge branch 'bodnia-issue-1745'
This commit is contained in:
11
dist/swagger-ui.js
vendored
11
dist/swagger-ui.js
vendored
@@ -25158,6 +25158,7 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
|
||||
|
||||
this.router = opts.router;
|
||||
|
||||
document.addEventListener('click', this.onLinkClick, true);
|
||||
// Sort APIs
|
||||
if (opts.swaggerOptions.apisSorter) {
|
||||
sorterOption = opts.swaggerOptions.apisSorter;
|
||||
@@ -25292,6 +25293,16 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
|
||||
|
||||
clear: function(){
|
||||
$(this.el).html('');
|
||||
},
|
||||
|
||||
onLinkClick: function (e) {
|
||||
var el = e.target;
|
||||
if (el.tagName === 'A') {
|
||||
if (location.hostname !== el.hostname || location.port !== el.port) {
|
||||
e.preventDefault();
|
||||
window.open(el.href, '_blank');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
4
dist/swagger-ui.min.js
vendored
4
dist/swagger-ui.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -14,6 +14,7 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
|
||||
|
||||
this.router = opts.router;
|
||||
|
||||
document.addEventListener('click', this.onLinkClick, true);
|
||||
// Sort APIs
|
||||
if (opts.swaggerOptions.apisSorter) {
|
||||
sorterOption = opts.swaggerOptions.apisSorter;
|
||||
@@ -148,5 +149,15 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
|
||||
|
||||
clear: function(){
|
||||
$(this.el).html('');
|
||||
},
|
||||
|
||||
onLinkClick: function (e) {
|
||||
var el = e.target;
|
||||
if (el.tagName === 'A') {
|
||||
if (location.hostname !== el.hostname || location.port !== el.port) {
|
||||
e.preventDefault();
|
||||
window.open(el.href, '_blank');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user