Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

allow two triggers for the same popup

  • Loading branch information...
commit 9c0aae6f2610157881093dd6c624682f774eef08 1 parent fa03921
@jlong jlong authored
Showing with 7 additions and 5 deletions.
  1. +7 −5 public/javascripts/admin/popup.js
View
12 public/javascripts/admin/popup.js
@@ -56,6 +56,8 @@ var Popup = {
zindex: 10000
};
+Popup.windows = [];
+
Popup.borderImages = function() {
return $A([
Popup.BorderImage,
@@ -77,13 +79,13 @@ Popup.preloadImages = function() {
}
Popup.TriggerBehavior = Behavior.create({
+
initialize: function(options) {
- var matches = this.element.href.match(/\#(.+)$/);
- if (matches) {
- this.window = new Popup.Window($(matches[1]), options);
- } else {
- this.window = new Popup.AjaxWindow(this.element.href, options);
+ if (!Popup.windows[this.element.href]) {
+ var matches = this.element.href.match(/\#(.+)$/);
+ Popup.windows[this.element.href] = (matches ? new Popup.Window($(matches[1]), options) : new Popup.AjaxWindow(this.element.href, options));
}
+ this.window = Popup.windows[this.element.href];
},
onclick: function(event) {
Please sign in to comment.
Something went wrong with that request. Please try again.