diff --git a/assets/js/album.js b/assets/js/album.js index 573cad3..e720862 100644 --- a/assets/js/album.js +++ b/assets/js/album.js @@ -222,8 +222,10 @@ album = { newTitle = (newTitle==="") ? "Untitled" : newTitle; if (visible.album()) { - + var id = albumIDs[0]; + album.json.title = newTitle; + albums.json.content[id].title = newTitle; view.album.title(); } else if (visible.albums()) { diff --git a/assets/min/main.js b/assets/min/main.js index 5760178..9db40e6 100644 --- a/assets/min/main.js +++ b/assets/min/main.js @@ -365,8 +365,10 @@ album = { newTitle = (newTitle==="") ? "Untitled" : newTitle; if (visible.album()) { - + var id = albumIDs[0]; + album.json.title = newTitle; + albums.json.content[id].title = newTitle; view.album.title(); } else if (visible.albums()) { @@ -553,7 +555,7 @@ albums = { startTime = new Date().getTime(); - if(this.json == null) { + if(albums.json == null) { lychee.api("getAlbums", function(data) { /* Smart Albums */ @@ -633,7 +635,7 @@ albums = { }, refresh: function() { - this.json = null; + albums.json = null; } }; @@ -834,8 +836,8 @@ build = { modal += "

Sign In

"; modal += ""; modal += "
"; - modal += ""; - modal += ""; + modal += ""; + modal += ""; modal += "
"; modal += "
Version " + lychee.version + "Update available!
"; modal += "Sign in"; @@ -4011,7 +4013,6 @@ view = { //restore scroll if (view.albums.content.scroll_pos != null) { - //$("html, body").setanimate({ scrollTop: view.albums.content.scroll_pos }, "slow"); $("html, body").scrollTop(view.albums.content.scroll_pos); } @@ -4114,8 +4115,7 @@ view = { view.albums.content.scroll_pos = $(document).scrollTop(); //scroll to top - $("html, body").animate({ scrollTop: 0 }, "slow"); - + $("html, body").scrollTop(0); }, title: function(photoID) { diff --git a/assets/min/view.js b/assets/min/view.js index 7ff23a9..c27f3d3 100644 --- a/assets/min/view.js +++ b/assets/min/view.js @@ -1,4 +1,4 @@ -function mobileBrowser(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)?!0:!1}function gup(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t="[\\?&]"+e+"=([^&#]*)",n=new RegExp(t),i=n.exec(window.location.href);return null===i?"":i[1]}function key(e){code=e.keyCode?e.keyCode:e.which,27===code&&visibleInfobox()&&(hideInfobox(),e.preventDefault())}function visibleInfobox(){return parseInt(infobox.css("right").replace("px",""))<0?!1:!0}function isPhotoSmall(e){return size=[["width",!1],["height",!1]],e.width<$(window).width()-60&&(size.width=!0),e.height<$(window).height()-100&&(size.height=!0),size.width&&size.height?!0:!1}function showInfobox(){$("body").append("
"),infobox.addClass("active")}function hideInfobox(){$("#infobox_overlay").removeClass("fadeIn").addClass("fadeOut"),setTimeout(function(){$("#infobox_overlay").remove()},300),infobox.removeClass("active")}function loadPhotoInfo(e){params="function=getPhoto&photoID="+e+"&albumID=0&password=''",$.ajax({type:"POST",url:api_path,data:params,dataType:"json",success:function(t){t.title||(t.title="Untitled"),document.title="Lychee - "+t.title,headerTitle.html(t.title),imageview.attr("data-id",e),isPhotoSmall(t)?imageview.html("
"):imageview.html("
"),imageview.removeClass("fadeOut").addClass("fadeIn").show(),infobox.html(build.infoboxPhoto(t,!0)).show()},error:ajaxError})}function ajaxError(e,t,n){console.log(e),console.log(t),console.log(n)}!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t=e.length,n=Z.type(e);return"function"===n||Z.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function i(e,t,n){if(Z.isFunction(t))return Z.grep(e,function(e,i){return!!t.call(e,i,e)!==n});if(t.nodeType)return Z.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return Z.filter(t,e,n);t=Z.filter(t,e)}return Z.grep(e,function(e){return U.call(t,e)>=0!==n})}function r(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function o(e){var t=ht[e]={};return Z.each(e.match(pt)||[],function(e,n){t[n]=!0}),t}function a(){Q.removeEventListener("DOMContentLoaded",a,!1),e.removeEventListener("load",a,!1),Z.ready()}function s(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=Z.expando+Math.random()}function u(e,t,n){var i;if(void 0===n&&1===e.nodeType)if(i="data-"+t.replace(xt,"-$1").toLowerCase(),n=e.getAttribute(i),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:bt.test(n)?Z.parseJSON(n):n}catch(r){}yt.set(e,t,n)}else n=void 0;return n}function l(){return!0}function c(){return!1}function f(){try{return Q.activeElement}catch(e){}}function d(e,t){return Z.nodeName(e,"table")&&Z.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function p(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function h(e){var t=Pt.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function g(e,t){for(var n=0,i=e.length;i>n;n++)vt.set(e[n],"globalEval",!t||vt.get(t[n],"globalEval"))}function m(e,t){var n,i,r,o,a,s,u,l;if(1===t.nodeType){if(vt.hasData(e)&&(o=vt.access(e),a=vt.set(t,o),l=o.events)){delete a.handle,a.events={};for(r in l)for(n=0,i=l[r].length;i>n;n++)Z.event.add(t,r,l[r][n])}yt.hasData(e)&&(s=yt.access(e),u=Z.extend({},s),yt.set(t,u))}}function v(e,t){var n=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&Z.nodeName(e,t)?Z.merge([e],n):n}function y(e,t){var n=t.nodeName.toLowerCase();"input"===n&&Ct.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function b(t,n){var i,r=Z(n.createElement(t)).appendTo(n.body),o=e.getDefaultComputedStyle&&(i=e.getDefaultComputedStyle(r[0]))?i.display:Z.css(r[0],"display");return r.detach(),o}function x(e){var t=Q,n=Rt[e];return n||(n=b(e,t),"none"!==n&&n||(Ft=(Ft||Z("