- /* attach the trigger */
- handle.mousedown(function(event) {
- var touch_data = {
- panel_root: root,
- panel: panel,
- hotspot_x: event.pageX - handle.position().left
- };
- $(this).trigger('hpanel:panel-resize-start', touch_data);
- return false;
- });
- prev = panel;
+ if( panel.hasClass('last-panel') )
+ overlay.css({'left': panel.css('left'), 'right': panel.css('right')});
+ else
+ overlay.css({'left': panel.css('left'), 'width': panel.css('width')});
+
+ if (prev) prev.next = overlay;
+
+ if(handle) {
+ overlay.append(handle.clone());
+ /* attach the trigger */
+ handle.mousedown(function(event) {
+ var touch_data = {
+ root: root, overlay: overlay,
+ hotspot_x: event.pageX - handle.position().left
+ };
+
+ $(this).trigger('hpanel:panel-resize-start', touch_data);
+ return false;
+ });
+ $('.panel-content', panel).css('right',
+ (handle.outerWidth() || 10) + 'px');
+ $('.panel-content-overlay', panel).css('right',
+ (handle.outerWidth() || 10) + 'px');
+ }
+
+ prev = overlay;