<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>javascripts/dragdrop.js</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -131,8 +131,14 @@ Popup.AbstractWindow = Class.create({
     body.insert(this.element);
   },
   
+  makeDraggable: function() {
+    console.log('making draggable');
+    new Draggable(this.element.identify(), {handle: 'h3.title'});
+  },
+  
   show: function() {
     this.beforeShow();
+    if (this.element.down('.popup.draggable')) this.makeDraggable();
     this.element.show();
     this.afterShow();
   },
@@ -182,8 +188,8 @@ Popup.AbstractWindow = Class.create({
 });
 
 Popup.Window = Class.create(Popup.AbstractWindow, {
-  initialize: function($super, element) {
-    $super();
+  initialize: function($super, element, options) {
+    $super(options);
     element.remove();
     this.content.update(element);
     element.show();</diff>
      <filename>javascripts/popup.js</filename>
    </modified>
    <modified>
      <diff>@@ -10,7 +10,7 @@ body {
 .popup {
   padding: 10px
 }
-.popup h3 {
+.popup h3.title {
   background-color: #6D84B4;
   border: 1px solid #3B5998;
   color: white;
@@ -24,4 +24,7 @@ body {
   border-top: none;
   margin: 0 -10px -10px -10px;
   padding: 1px 9px;
+}
+.popup.draggable h3.title {
+  cursor: move;
 }
\ No newline at end of file</diff>
      <filename>stylesheets/facebook.css</filename>
    </modified>
    <modified>
      <diff>@@ -5,12 +5,13 @@
     %link{:rel=&gt;&quot;stylesheet&quot;, :type=&gt;&quot;text/css&quot;, :href=&gt;&quot;/stylesheets/facebook.css&quot;}/
     %script{:type=&gt;&quot;text/javascript&quot;, :src=&gt;&quot;/javascripts/prototype.js&quot;}
     %script{:type=&gt;&quot;text/javascript&quot;, :src=&gt;&quot;/javascripts/effects.js&quot;}
+    / Required if you want draggable windows
+    %script{:type=&gt;&quot;text/javascript&quot;, :src=&gt;&quot;/javascripts/dragdrop.js&quot;}
     %script{:type=&gt;&quot;text/javascript&quot;, :src=&gt;&quot;/javascripts/lowpro.js&quot;}
     %script{:type=&gt;&quot;text/javascript&quot;, :src=&gt;&quot;/javascripts/popup.js&quot;}
     %script{:type=&gt;&quot;text/javascript&quot;}
       :plain
         Event.addBehavior({ 'a.popup': Popup.TriggerBehavior() });
-    
   %body
     %p
       %a.popup{:href=&gt;&quot;#test&quot;} Popup
@@ -21,19 +22,29 @@
     %p
       %a.popup{:href=&gt;&quot;#search&quot;} Popup Input
     
+    %p
+      %a.popup{:href=&gt;&quot;#dragme&quot;} Draggable
+    
     .popup#test{:style=&gt;&quot;display: none&quot;}
-      %h3 Popup Window
+      %h3.title Popup Window
       .popup_content
         %p Hello world!
         %p
           %a{:href=&gt;&quot;javascript: Element.closePopup('test')&quot;} Close
     
     .popup#search{:style=&gt;&quot;display: none&quot;}
-      %h3 Search
+      %h3.title Search
       .popup_content
         %form
           %p
             %input{:type=&gt;&quot;text&quot;, :name=&gt;&quot;query&quot;, :id=&gt;&quot;query&quot;, :value=&gt;&quot;&quot;}/
           %p
             %a{:href=&gt;&quot;javascript: Element.closePopup('search')&quot;} Close
+    
+    .popup.draggable#dragme{:style=&gt;&quot;display: none&quot;}
+      %h3.title Drag Me
+      .popup_content
+        %p Try dragging me around by my title.
+        %p
+          %a{:href=&gt;&quot;javascript: Element.closePopup('dragme')&quot;} Close
     
\ No newline at end of file</diff>
      <filename>test/index.haml</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b8256e8c4c2b4aabd8dd43380e7c3c3461ba8f11</id>
    </parent>
  </parents>
  <author>
    <name>John W. Long</name>
    <email>me@johnwlong.com</email>
  </author>
  <url>http://github.com/jlong/popupjs/commit/67b3933462b24bc7647d4639afbb70b91dd87b90</url>
  <id>67b3933462b24bc7647d4639afbb70b91dd87b90</id>
  <committed-date>2008-07-09T19:12:18-07:00</committed-date>
  <authored-date>2008-07-09T19:12:18-07:00</authored-date>
  <message>make popups draggable</message>
  <tree>6fb231aea6fd0db03b2a3159bade042f69a3f1f0</tree>
  <committer>
    <name>John W. Long</name>
    <email>me@johnwlong.com</email>
  </committer>
</commit>
