<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -141,6 +141,14 @@ Popup.AbstractWindow = Class.create({
     this.element.hide();
   },
   
+  toggle: function() {
+    if (this.element.visible()) {
+      this.hide();
+    } else {
+      this.show();
+    }
+  },
+  
   focus: function() {
     var form = this.element.down('form');
     if (form) {
@@ -183,13 +191,20 @@ Popup.Window = Class.create(Popup.AbstractWindow, {
 });
 
 Popup.AjaxWindow = Class.create(Popup.AbstractWindow, {
-  initialize: function($super, url) {
+  initialize: function($super, url, options) {
     $super();
+    options = Object.extend({reload: true}, options);
     this.url = url;
+    this.reload = options.reload;
   },
   
   show: function($super) {
-    new Ajax.Updater(this.content, this.url, {asynchronous: false, method: &quot;get&quot;, onComplete: $super});
+    if (!this.shown || this.reload) {
+      new Ajax.Updater(this.content, this.url, {asynchronous: false, method: &quot;get&quot;, onComplete: $super});
+      this.loaded = true;
+    } else {
+      $super();
+    }
   }
 });
 </diff>
      <filename>javascripts/popup.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2f88ec024084a831eebac16c34b77d1d6d908d79</id>
    </parent>
  </parents>
  <author>
    <name>John W. Long</name>
    <email>me@johnwlong.com</email>
  </author>
  <url>http://github.com/jlong/popupjs/commit/9e6125ef951831dde87a8d9d193c43d0f69c8da1</url>
  <id>9e6125ef951831dde87a8d9d193c43d0f69c8da1</id>
  <committed-date>2008-05-29T21:23:01-07:00</committed-date>
  <authored-date>2008-05-29T21:23:01-07:00</authored-date>
  <message>prototype: add option to Popup.AjaxWindow constructor to allow the contents to only be loaded once</message>
  <tree>2e02446082cd7dc630cd328a090d31a96832720b</tree>
  <committer>
    <name>John W. Long</name>
    <email>me@johnwlong.com</email>
  </committer>
</commit>
