Browse Source

Replaced lychee.goto('') with lychee.goto()

Tobias Reich 8 years ago
parent
commit
20963ac463
5 changed files with 7 additions and 8 deletions
  1. 2 2
      src/scripts/album.js
  2. 1 1
      src/scripts/header.js
  3. 1 1
      src/scripts/init.js
  4. 2 3
      src/scripts/lychee.js
  5. 1 1
      src/scripts/upload.js

+ 2 - 2
src/scripts/album.js

@@ -55,7 +55,7 @@ album.load = function(albumID, refresh = false) {
 				} else {
 					// Album not public
 					lychee.content.show()
-					lychee.goto('')
+					lychee.goto()
 				}
 				return false
 			}
@@ -178,7 +178,7 @@ album.delete = function(albumIDs) {
 			} else {
 
 				albums.refresh()
-				lychee.goto('')
+				lychee.goto()
 
 			}
 

+ 1 - 1
src/scripts/header.js

@@ -52,7 +52,7 @@ header.bind = function() {
 	header.dom('#button_trash')       .on(eventName, function() { photo.delete([ photo.getID() ]) })
 	header.dom('#button_archive')     .on(eventName, function() { album.getArchive(album.getID()) })
 	header.dom('#button_star')        .on(eventName, function() { photo.setStar([ photo.getID() ]) })
-	header.dom('#button_back_home')   .on(eventName, function() { lychee.goto('') })
+	header.dom('#button_back_home')   .on(eventName, function() { lychee.goto() })
 	header.dom('#button_back')        .on(eventName, function() { lychee.goto(album.getID()) })
 
 	header.dom('.header__search').on('keyup click', function() { search.find($(this).val()) })

+ 1 - 1
src/scripts/init.js

@@ -68,7 +68,7 @@ $(document).ready(function() {
 		if (basicModal.visible()===true)                                             basicModal.cancel()
 		else if (visible.contextMenu())                                              contextMenu.close()
 		else if (visible.photo())                                                    lychee.goto(album.getID())
-		else if (visible.album())                                                    lychee.goto('')
+		else if (visible.album())                                                    lychee.goto()
 		else if (visible.albums() && header.dom('.header__search').val().length!==0) search.reset()
 		return false
 	})

+ 2 - 3
src/scripts/lychee.js

@@ -156,10 +156,9 @@ lychee.logout = function() {
 
 }
 
-lychee.goto = function(url) {
+lychee.goto = function(url = '') {
 
-	if (url===undefined) url = '#'
-	else                 url = '#' + url
+	url = '#' + url
 
 	history.pushState(null, null, url)
 	lychee.load()

+ 1 - 1
src/scripts/upload.js

@@ -386,7 +386,7 @@ upload.start = {
 
 						// Go back to the album overview to show the imported albums
 						if (visible.albums()) lychee.load()
-						else                  lychee.goto('')
+						else                  lychee.goto()
 
 						basicModal.close()