cahnge link format for accessibility.

This commit is contained in:
BoHung Chiu 2020-03-27 16:50:29 +08:00
parent 71d9785a5f
commit 76bf583da5
3 changed files with 6 additions and 4 deletions

View File

@ -1,4 +1,4 @@
var GalleryTheater = function(){
window.GalleryTheater = function(){
var parent_divs = $('.gallery').parents('div'),
parent_div_z_index = parent_divs.eq(parent_divs.length-1).css('z-index')
parent_divs.eq(parent_divs.length-1).css('z-index','2000')
@ -188,6 +188,7 @@ var GalleryTheater = function(){
gt.stage.show();
$("body").addClass("gallery-mode-on");
bindKeyHandlers();
gt.isTheaterInitialized = false;
if(!gt.isTheaterInitialized){
$.ajax({
url : link,
@ -206,6 +207,7 @@ var GalleryTheater = function(){
currentPic = {"image" : cp, "index" : gt.albumData.images.indexOf(cp)};
createThumbStrip();
}
window.currentPic = currentPic;
}
gt.hasNextImage = function(){
@ -398,7 +400,7 @@ var GalleryTheater = function(){
mainPicLoading = 1;
img.fadeIn(100);
}
var setMainPic = function(direction,selectedFromStrip){
window.setMainPic = function(direction,selectedFromStrip){
var img = null;
$('div.gallery-show-original a').eq(0).attr('href',currentPic.image.url)
if(direction == null){

View File

@ -65,7 +65,7 @@ class GalleriesController < ApplicationController
{
"image-description" => (flag ? a.description : ''),
"alt_title" => alt_text,
"link_to_show" => "/xhr/galleries/theater/" + a.id.to_s,
"link_to_show" => "#" + a.id.to_s,
"thumb-src" => a.file.thumb.url
}
end

View File

@ -7,7 +7,7 @@
<div class="show-content col-xs-6 col-sm-2">
<div class="show-content-inner">
<div class="show-pic">
<a href="{{link_to_show}}">
<a href="{{link_to_show}}" onclick="window.location.hash = '{{link_to_show}}';GalleryTheater();">
<img class="img" src="{{thumb-src}}" alt="{{alt_title}}">
</a>
<p class="show-description">{{image-description}}</p>