summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-07-30 21:00:10 +0800
committerTim Almdal <tnalmdal@shaw.ca>2009-07-31 20:43:34 +0800
commit64aa96b5527b0a887800bb4d7868495b4397da74 (patch)
tree5892252d0041cd573c7ac55473698a33161772f5
parent19d89f94f9939bbd879d6c8ead4e802f592ec808 (diff)
Move the getViewportSize method to gallery.common.js
Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
-rw-r--r--lib/gallery.common.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/gallery.common.js b/lib/gallery.common.js
index 14c28a56..599f23d1 100644
--- a/lib/gallery.common.js
+++ b/lib/gallery.common.js
@@ -27,3 +27,21 @@
});
};
})(jQuery);
+
+// Get the viewport size
+(function () {
+ $.getViewportSize = function() {
+ return {
+ width : function() {
+ return window.innerWidth
+ || document.documentElement && document.documentElement.clientWidth
+ || document.body.clientWidth;
+ },
+ height : function() {
+ return window.innerHeight
+ || document.documentElement && document.documentElement.clientHeight
+ || document.body.clientHeight;
+ }
+ };
+ };
+})(jQuery);