frontend gallery fix

This commit is contained in:
Harry Bomrah 2013-07-18 17:04:33 +08:00 committed by chris
parent c7ac4e2485
commit b1d8a87256
2 changed files with 6 additions and 5 deletions

View File

@ -69,7 +69,7 @@ var galleryAPI = function(){
this.loadImages = function(id){
g.albumArea.addClass('o_album');
g.albumArea.find("#imgholder").empty();
$.getJSON("panel/gallery/front_end/albums/"+id+"/imgs",{inner:true},function(album){
$.getJSON("/panel/gallery/front_end/albums/"+id+"/imgs",{inner:true},function(album){
$.each(album.images,function(i,image){
var thumb = image.file.thumb.url;
image.description = (image.description?image.description:"<%= I18n.t('gallery.no_description') %>")
@ -218,6 +218,7 @@ var galleryAPI = function(){
}
// $(".slideinfo b.info").text(imageArray[imagecount].title);
updatePhotoTag();
if(imageArray[imagecount].description)
$(".slideinfo .info").text(imageArray[imagecount].description);
if(imageArray.length > 1)
updateNavigation();
@ -244,7 +245,7 @@ var galleryAPI = function(){
}
var preparestage = function(albumid){
$.getJSON("panel/gallery/front_end/albums/"+albumid+"/imgs",{"inner":true},function(album){
$.getJSON("/panel/gallery/front_end/albums/"+albumid+"/imgs",{"inner":true},function(album){
imageArray = eval(album.images);
$.each(album.images,function(i,image){
if(image._id == id)

View File

@ -85,8 +85,8 @@ class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
@albumid = @image.gallery_album_id
@album = GalleryAlbum.find(@albumid)
@images = @album.gallery_images.all
tags = @album.tag_ids
@tagnames = Tag.find(tags.tagged_ids).map{|t| t.name}
# tags = @album.tag_ids
@tagnames = @album.tags.map{|t|t.name}
@back_link = panel_gallery_front_end_album_path(@albumid)
end
end