- /* 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 (prev) prev.next = overlay;
+
+ if(handle.length != 0) {
+ $.log('Has handle: ' + panel.attr('id') );
+ 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;