mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-09 02:59:27 +03:00
Merge pull request #293 from marcj/patch-1
Remove the annoying scroll-jumping on method-click.
This commit is contained in:
commit
7380f95fa5
@ -49,10 +49,13 @@
|
|||||||
</p>
|
</p>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(window).load(function() {
|
||||||
var elem = $(window.location.hash);
|
var id = (window.location.hash || '').substr(1).replace( /([:\.\[\]\{\}])/g, "\\$1");
|
||||||
if(elem) {
|
var elem = $('#' + id);
|
||||||
$('body').scrollTop(elem.top);
|
if (elem.length) {
|
||||||
|
setTimeout(function() {
|
||||||
|
$('body,html').scrollTop(elem.position().top);
|
||||||
|
});
|
||||||
elem.find('a.toggler').click();
|
elem.find('a.toggler').click();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -295,19 +298,26 @@
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.pane.sandbox').delegate('.to-raw', 'click', function(e) {
|
$('.operations').on('click', '.operation > a', function(e) {
|
||||||
|
if (history.pushState) {
|
||||||
|
history.pushState(null, null, $(this).attr('href'));
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.pane.sandbox').on('click', '.to-raw', function(e) {
|
||||||
renderRawBody($(this).parents('.pane').find('.response'));
|
renderRawBody($(this).parents('.pane').find('.response'));
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.pane.sandbox').delegate('.to-prettify', 'click', function(e) {
|
$('.pane.sandbox').on('click', '.to-prettify', function(e) {
|
||||||
renderPrettifiedBody($(this).parents('.pane').find('.response'));
|
renderPrettifiedBody($(this).parents('.pane').find('.response'));
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.pane.sandbox').delegate('.to-expand, .to-shrink', 'click', function(e) {
|
$('.pane.sandbox').on('click', '.to-expand, .to-shrink', function(e) {
|
||||||
var $headers = $(this).parents('.result').find('.headers');
|
var $headers = $(this).parents('.result').find('.headers');
|
||||||
var $label = $(this).parents('.result').find('a.to-expand');
|
var $label = $(this).parents('.result').find('a.to-expand');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user