MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / add_sidebar_button

Function add_sidebar_button

doc/static/sidebar.js:98–141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

96 }
97
98 function add_sidebar_button() {
99 sidebarwrapper.css({
100 'float': 'left',
101 'margin-right': '0',
102 'width': ssb_width_expanded - 28
103 });
104 // create the button
105 sidebar.append(
106 '<div id="sidebarbutton"><span>&laquo;</span></div>'
107 );
108 var sidebarbutton = $('#sidebarbutton');
109 // find the height of the viewport to center the '<<' in the page
110 var viewport_height = get_viewport_height();
111 var sidebar_offset = sidebar.offset().top;
112 var sidebar_height = Math.max(bodywrapper.height(), sidebar.height());
113 sidebarbutton.find('span').css({
114 'display': 'block',
115 'position': 'fixed',
116 'top': Math.min(viewport_height/2, sidebar_height/2 + sidebar_offset) - 10
117 });
118
119 sidebarbutton.click(toggle_sidebar);
120 sidebarbutton.attr('title', _('Collapse sidebar'));
121 sidebarbutton.css({
122 'border-radius': '0 5px 5px 0',
123 'color': '#444444',
124 'background-color': '#CCCCCC',
125 'font-size': '1.2em',
126 'cursor': 'pointer',
127 'height': sidebar_height,
128 'padding-top': '1px',
129 'padding-left': '1px',
130 'margin-left': ssb_width_expanded - 12
131 });
132
133 sidebarbutton.hover(
134 function () {
135 $(this).css('background-color', dark_color);
136 },
137 function () {
138 $(this).css('background-color', light_color);
139 }
140 );
141 }
142
143 function set_position_from_cookie() {
144 if (!document.cookie)

Callers 1

sidebar.jsFile · 0.85

Calls 4

get_viewport_heightFunction · 0.85
maxMethod · 0.45
findMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected