|
95 | 95 | */ |
96 | 96 | width: function($container, options) { |
97 | 97 | options = options ? options : {}; |
98 | | - var width = $container.find('div.panel').size() < 1 || options.maximized == true ? |
| 98 | + var width = $container.find('div.panel').size() < 1 || !options.partial ? |
99 | 99 | $container.width() : $container.width() - $container.width() / 4; |
100 | 100 |
|
101 | 101 | return width; |
|
105 | 105 | * Get left position |
106 | 106 | */ |
107 | 107 | position: function($container, options) { |
108 | | - return $container.find('div.panel').size() <= 1 || options.maximized == true ? |
| 108 | + return $container.find('div.panel').size() <= 1 || !options.partial ? |
109 | 109 | 0 : _panel.width($container, options) - _panel.width($container, options) / 1.5; |
110 | 110 | }, |
111 | 111 |
|
|
160 | 160 | var $panel = $('<div>').addClass('panel').css({ |
161 | 161 | position: 'absolute', |
162 | 162 | width: _panel.width($container, { |
163 | | - maximized: options.maximized |
| 163 | + partial: options.partial |
164 | 164 | }), |
165 | 165 | zIndex: _panel.topIndex($container) |
166 | 166 | }).append( |
167 | 167 | // Shadow |
168 | 168 | $('<div>').addClass('shadow') |
169 | 169 | ).append(options.data); |
170 | 170 |
|
171 | | - if (options.maximized) $panel.addClass('always-maximized'); |
172 | | - |
173 | 171 | return $panel; |
174 | 172 | } |
175 | 173 | }; |
|
195 | 193 | var $toRemove = _panel.higher($container, $panel); |
196 | 194 | var complete = args.complete; |
197 | 195 |
|
198 | | - if ($panel.hasClass('maximized')) return false; |
199 | | - |
200 | 196 | _breadcrumb.filter($toRemove).remove(); |
201 | 197 | _breadcrumb.filter($panel.siblings()).removeClass('active'); |
202 | 198 | _breadcrumb.filter($panel).addClass('active'); |
203 | | - _breadcrumb.filter($('div.panel')).find('span').animate({ |
| 199 | + _breadcrumb.filter($('div.panel')).find('span').css({ |
204 | 200 | opacity: 1 |
205 | 201 | }); |
206 | 202 | _breadcrumb.filter( |
|
209 | 205 | .addClass('reduced') |
210 | 206 | ).removeClass('active maximized'); |
211 | 207 |
|
212 | | - $toRemove.animate( |
| 208 | + $toRemove.css( |
213 | 209 | _panel.initialState($container), { |
214 | 210 | duration: 500, |
215 | 211 | complete: function() { |
|
220 | 216 | } |
221 | 217 | ); |
222 | 218 | $toShow.show(); |
223 | | - $panel.animate({ |
| 219 | + $panel.css({ |
224 | 220 | left: _panel.position($container, { |
225 | 221 | maximized: $panel.hasClass('always-maximized') |
226 | 222 | }) |
|
241 | 237 | _breadcrumb.filter($panel).removeClass('maximized'); |
242 | 238 | $panel.removeClass('maximized'); |
243 | 239 | $panel.addClass('reduced'); |
244 | | - _breadcrumb.filter($panel.siblings()).find('span').animate({ |
| 240 | + _breadcrumb.filter($panel.siblings()).find('span').css({ |
245 | 241 | opacity: 1 |
246 | 242 | }); |
247 | | - $toHide.animate({ |
| 243 | + $toHide.css({ |
248 | 244 | left: _panel.position($container, {}) |
249 | | - }, { |
250 | | - duration: 500 |
251 | 245 | }); |
252 | 246 | $shadow.show(); |
253 | 247 | } else { |
254 | 248 | _breadcrumb.filter($panel).addClass('maximized'); |
255 | 249 | $panel.removeClass('reduced'); |
256 | 250 | $panel.addClass('maximized'); |
257 | | - _breadcrumb.filter($panel.siblings()).find('span').animate({ |
258 | | - opacity: 0.5 |
259 | | - }); |
260 | | - $toHide.animate(_panel.initialState($container), { |
261 | | - duration: 500 |
262 | | - }); |
| 251 | + $toHide.css(_panel.initialState($container)); |
263 | 252 | $shadow.hide(); |
264 | 253 | } |
265 | 254 | }, |
|
275 | 264 |
|
276 | 265 | // Create panel |
277 | 266 | $panel = _panel.create(this.element, { |
278 | | - maximized: args.maximizeIfSelected, |
| 267 | + partial: args.partial, |
279 | 268 | data: args.data |
280 | 269 | }); |
281 | 270 |
|
|
315 | 304 |
|
316 | 305 | // Panel slide-in |
317 | 306 | targetPosition = _panel.position($container, { |
318 | | - maximized: args.maximizeIfSelected |
| 307 | + maximized: args.maximizeIfSelected, |
| 308 | + partial: args.partial |
319 | 309 | }); |
320 | 310 | if (!$panel.index()) { |
321 | 311 | // Just show immediately if this is the first panel |
|
325 | 315 | if (args.complete) args.complete($panel, _breadcrumb.filter($panel)); |
326 | 316 | } else { |
327 | 317 | // Animate slide-in |
328 | | - $panel.animate({ |
| 318 | + $panel.css({ |
329 | 319 | left: targetPosition |
330 | | - }, { |
331 | | - duration: duration, |
332 | | - easing: 'easeOutCirc', |
333 | | - complete: function() { |
334 | | - // Hide panels |
335 | | - $panel.siblings().filter(function() { |
336 | | - return $(this).width() == $panel.width(); |
337 | | - }); |
| 320 | + }); |
338 | 321 |
|
339 | | - if ($panel.is(':visible') && args.complete) args.complete($panel); |
340 | | - } |
| 322 | + // Hide panels |
| 323 | + $panel.siblings().filter(function() { |
| 324 | + return $(this).width() == $panel.width(); |
341 | 325 | }); |
| 326 | + |
| 327 | + if ($panel.is(':visible') && args.complete) args.complete($panel); |
342 | 328 | }; |
343 | 329 |
|
344 | 330 | return $panel; |
|
0 commit comments