Only highlight the thumbnail image in album view when user is logged in
This commit is contained in:
parent
3ba6dc6eb3
commit
6c71969598
|
@ -7,6 +7,7 @@ $data["albumcontents"] = "";
|
||||||
$data["albumtitle"] = "";
|
$data["albumtitle"] = "";
|
||||||
$data["albumdescription"] = "";
|
$data["albumdescription"] = "";
|
||||||
$data["images"] = array();
|
$data["images"] = array();
|
||||||
|
$data["loggedin"] = $currentuser->isLoggedIn();
|
||||||
|
|
||||||
if ( $_SESSION['currentalbum'] != 0 ) {
|
if ( $_SESSION['currentalbum'] != 0 ) {
|
||||||
$album = new Album($_SESSION['currentalbum']);
|
$album = new Album($_SESSION['currentalbum']);
|
||||||
|
|
|
@ -20,6 +20,7 @@ $album->setThumbnail($image->getFileName());
|
||||||
$album->save();
|
$album->save();
|
||||||
|
|
||||||
$data["success"] = true;
|
$data["success"] = true;
|
||||||
|
$data["loggedin"] = $currentuser->isLoggedIn();
|
||||||
$data["album"] = $album;
|
$data["album"] = $album;
|
||||||
|
|
||||||
sendResponse($data);
|
sendResponse($data);
|
||||||
|
|
|
@ -106,7 +106,9 @@ function getAlbumInfo() {
|
||||||
$("#albumdescription").text(data.albumdescription);
|
$("#albumdescription").text(data.albumdescription);
|
||||||
$("#albumcontents").html(data.albumcontents);
|
$("#albumcontents").html(data.albumcontents);
|
||||||
if ( data.currentalbum != 0 ) {
|
if ( data.currentalbum != 0 ) {
|
||||||
|
if ( data.loggedin ) {
|
||||||
$("#griditem_"+data.thumbnailid).addClass("activethumbnail");
|
$("#griditem_"+data.thumbnailid).addClass("activethumbnail");
|
||||||
|
}
|
||||||
$(".btn_setthumbnail").click(function() { setAlbumThumbnail($(this)) });
|
$(".btn_setthumbnail").click(function() { setAlbumThumbnail($(this)) });
|
||||||
}
|
}
|
||||||
$(".albumthumbnail").click(function() {
|
$(".albumthumbnail").click(function() {
|
||||||
|
@ -142,7 +144,7 @@ function setAlbumThumbnail(clickedElement) {
|
||||||
},
|
},
|
||||||
success: function(data, stat, jqo) {
|
success: function(data, stat, jqo) {
|
||||||
$(".thumbnail_grid").removeClass("activethumbnail");
|
$(".thumbnail_grid").removeClass("activethumbnail");
|
||||||
$("#griditem_"+imageid).addClass("activethumbnail");
|
if ( data.loggedin ) $("#griditem_"+imageid).addClass("activethumbnail");
|
||||||
},
|
},
|
||||||
error: function(jqp, status, error) {
|
error: function(jqp, status, error) {
|
||||||
toastr.error("Error setting thumbnail!\n" + error, "Server Error");
|
toastr.error("Error setting thumbnail!\n" + error, "Server Error");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user