photomix/public/javascripts/application.js

43 lines
1.4 KiB
JavaScript
Raw Normal View History

2009-05-25 21:39:43 +02:00
jQuery(function($) {
if ( $('ul.gallery').length ) {
$('ul.gallery').galleria( {
clickNext : true,
insert: "#photo_large",
onImage: function ( image, caption, thumb ) {
image.css('display','none').fadeIn()
thumb.parents('li').siblings().children('img.selected').fadeTo(500,0.3)
thumb.fadeTo('fast',1).addClass('selected')
$( '#photo_metadata' ).html( '<a href=\'/photos/' + thumb.attr('id').replace('thumb_', '') + '/edit\'>Update photo details</a>' )
var scrollable = $("#thumbstrip").scrollable()
scrollable.seekTo( thumb.parents('ul').children().index( thumb.parents('li') ) )
},
onThumb: function ( thumb) {
thumb.css({display:'none',opacity: (thumb.parents('li').is('.active') ? '1' : '0.3') }).fadeIn(1500)
}
})
}
if ( $('#thumbstrip').length ) {
$('#thumbstrip').scrollable( {
items : '#thumbs',
clickable: true,
keyboard : false
})
if ( $('#thumbs li.active').length == 0 ){
//$('div.scrollable').scrollable().click(0)
$('#thumbs li:first').addClass('active')
}
}
if ( $('#photo_tag_list').length ) {
$('#photo_tag_list').tagSuggest({
tags: $('#all_tags').val().split('\'')
})
}
2009-06-02 00:08:57 +02:00
if ( $('FORM #upload').length ) {
}
2009-05-25 21:39:43 +02:00
//$('div.scrollable').scrollable().click( $('#gallery ul').children().index( $('#gallery li.active') ) )
});