Browse Source

Added fullscreen on mobile

Tobias Reich 11 years ago
parent
commit
28638d2163
2 changed files with 12 additions and 2 deletions
  1. 0 0
      assets/build/main.js
  2. 12 2
      assets/js/view.js

File diff suppressed because it is too large
+ 0 - 0
assets/build/main.js


+ 12 - 2
assets/js/view.js

@@ -33,7 +33,9 @@ view = {
 
 		},
 
-		hide: function() {
+		hide: function(e, delay) {
+
+			if (delay===undefined) delay = 500;
 
 			if (visible.photo()&&!visible.infobox()&&!visible.contextMenu()&&!visible.message()) {
 				clearTimeout($(window).data("timeout"));
@@ -53,7 +55,7 @@ view = {
 							left: 0
 						});
 					}
-				}, 500));
+				}, delay));
 			}
 
 		},
@@ -375,6 +377,14 @@ view = {
 				.bind("mouseenter", view.header.show)
 				.bind("mouseleave", view.header.hide);
 
+			// Fullscreen on mobile
+			if (mobileBrowser()) {
+				$(document).on("touchend", "#image", function() {
+					if (visible.controls()) view.header.hide(null, 0);
+					else view.header.show();
+				});
+			}
+
 			lychee.animate(lychee.imageview, "fadeIn");
 
 		},

Some files were not shown because too many files changed in this diff