summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-08-05 10:25:23 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-08-05 10:25:23 -0700
commit7b1cca168cb9b29fcccdcdce9e32efb190e4575e (patch)
tree1dd6668463cecb755325f0644945897bdbe98423 /lib
parent9f396178cedc96abb282e72ff0e843e255c8225a (diff)
Revert "Revert "Allow a theme to override the page refresh mechanism. Create a new""
This reverts commit 9f396178cedc96abb282e72ff0e843e255c8225a.
Diffstat (limited to 'lib')
-rw-r--r--lib/gallery.dialog.js4
-rw-r--r--lib/gallery.panel.js4
-rw-r--r--lib/gallery.reload.js16
3 files changed, 20 insertions, 4 deletions
diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js
index 74c2f20e..0efcf120 100644
--- a/lib/gallery.dialog.js
+++ b/lib/gallery.dialog.js
@@ -25,9 +25,9 @@ function ajaxify_dialog() {
}
if (data.result == "success") {
if (data.location) {
- window.location = data.location;
+ $.gallery_location(data.location);
} else {
- window.location.reload();
+ $.gallery_reload();
}
}
}
diff --git a/lib/gallery.panel.js b/lib/gallery.panel.js
index 022e4878..26be11ad 100644
--- a/lib/gallery.panel.js
+++ b/lib/gallery.panel.js
@@ -40,9 +40,9 @@ function togglePanel(element, on_success) {
if (on_success) {
on_success();
} else if (data.location) {
- window.location = data.location;
+ $.gallery_location(data.location);
} else {
- window.location.reload();
+ $.gallery_reload();
}
}
}
diff --git a/lib/gallery.reload.js b/lib/gallery.reload.js
new file mode 100644
index 00000000..2c8752a0
--- /dev/null
+++ b/lib/gallery.reload.js
@@ -0,0 +1,16 @@
+/**
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+(function ($) {
+ $.gallery_reload = function() {
+ window.location.reload();
+ };
+})(jQuery);
+
+// Vertically align a block element's content
+(function ($) {
+ $.gallery_location = function(location) {
+ window.location = location;
+ };
+})(jQuery);