| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,9 +25,7 @@ $(function() { | |||
| 25 | 25 | // global elements used by the functions. | |
| 26 | 26 | // the 'sidebarbutton' element is defined as global after its | |
| 27 | 27 | // creation, in the add_sidebar_button function | |
| 28 | - var jwindow = $(window); | ||
| 29 | 28 | var bodywrapper = $('.bodywrapper'); | |
| 30 | - var documentwrapper = $('.documentwrapper'); | ||
| 31 | 29 | var sidebar = $('.sphinxsidebar'); | |
| 32 | 30 | var sidebarwrapper = $('.sphinxsidebarwrapper'); | |
| 33 | 31 | ||
@@ -45,13 +43,6 @@ $(function() { | |||
| 45 | 43 | var dark_color = '#AAAAAA'; | |
| 46 | 44 | var light_color = '#CCCCCC'; | |
| 47 | 45 | ||
| 48 | - function get_viewport_height() { | ||
| 49 | - if (window.innerHeight) | ||
| 50 | - return window.innerHeight; | ||
| 51 | - else | ||
| 52 | - return jwindow.height(); | ||
| 53 | - } | ||
| 54 | - | ||
| 55 | 46 | function sidebar_is_collapsed() { | |
| 56 | 47 | return sidebarwrapper.is(':not(:visible)'); | |
| 57 | 48 | } | |
@@ -69,7 +60,6 @@ $(function() { | |||
| 69 | 60 | bodywrapper.css('margin-left', bw_margin_collapsed); | |
| 70 | 61 | sidebarbutton.css({ | |
| 71 | 62 | 'margin-left': '0', | |
| 72 | - 'height': documentwrapper.height(), | ||
| 73 | 63 | 'border-radius': '5px' | |
| 74 | 64 | }); | |
| 75 | 65 | sidebarbutton.find('span').text('»'); | |
@@ -83,13 +73,10 @@ $(function() { | |||
| 83 | 73 | sidebarwrapper.show(); | |
| 84 | 74 | sidebarbutton.css({ | |
| 85 | 75 | 'margin-left': ssb_width_expanded-12, | |
| 86 | - 'height': Math.max(sidebarwrapper.height(), documentwrapper.height()), | ||
| 87 | 76 | 'border-radius': '0 5px 5px 0' | |
| 88 | 77 | }); | |
| 89 | 78 | sidebarbutton.find('span').text('«'); | |
| 90 | 79 | sidebarbutton.attr('title', _('Collapse sidebar')); | |
| 91 | - //sidebarwrapper.css({'padding-top': | ||
| 92 | - // Math.max(window.pageYOffset - sidebarwrapper.offset().top, 10)}); | ||
| 93 | 80 | document.cookie = 'sidebar=expanded'; | |
| 94 | 81 | } | |
| 95 | 82 | ||
@@ -104,14 +91,10 @@ $(function() { | |||
| 104 | 91 | '<div id="sidebarbutton"><span>«</span></div>' | |
| 105 | 92 | ); | |
| 106 | 93 | var sidebarbutton = $('#sidebarbutton'); | |
| 107 | - // find the height of the viewport to center the '<<' in the page | ||
| 108 | - var viewport_height = get_viewport_height(); | ||
| 109 | - var sidebar_offset = sidebar.offset().top; | ||
| 110 | - var sidebar_height = Math.max(documentwrapper.height(), sidebar.height()); | ||
| 111 | 94 | sidebarbutton.find('span').css({ | |
| 112 | 95 | 'display': 'block', | |
| 113 | 96 | 'position': 'fixed', | |
| 114 | - 'top': Math.min(viewport_height/2, sidebar_height/2 + sidebar_offset) - 10 | ||
| 97 | + 'top': '50%' | ||
| 115 | 98 | }); | |
| 116 | 99 | ||
| 117 | 100 | sidebarbutton.click(toggle_sidebar); | |
@@ -122,8 +105,7 @@ $(function() { | |||
| 122 | 105 | 'background-color': '#CCCCCC', | |
| 123 | 106 | 'font-size': '1.2em', | |
| 124 | 107 | 'cursor': 'pointer', | |
| 125 | - 'height': sidebar_height, | ||
| 126 | - 'padding-top': '1px', | ||
| 108 | + 'height': '100%', | ||
| 127 | 109 | 'padding-left': '1px', | |
| 128 | 110 | 'margin-left': ssb_width_expanded - 12 | |
| 129 | 111 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments