From 76bf583da57125c5354e697ee66222e33eb2bf17 Mon Sep 17 00:00:00 2001 From: bohung Date: Fri, 27 Mar 2020 16:50:29 +0800 Subject: [PATCH] cahnge link format for accessibility. --- app/assets/javascripts/theater.js | 6 ++++-- app/controllers/galleries_controller.rb | 2 +- modules/gallery/show.html.erb | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/theater.js b/app/assets/javascripts/theater.js index f4574a5..0ba6a19 100644 --- a/app/assets/javascripts/theater.js +++ b/app/assets/javascripts/theater.js @@ -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){ diff --git a/app/controllers/galleries_controller.rb b/app/controllers/galleries_controller.rb index 27c344a..9d51c4f 100644 --- a/app/controllers/galleries_controller.rb +++ b/app/controllers/galleries_controller.rb @@ -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 diff --git a/modules/gallery/show.html.erb b/modules/gallery/show.html.erb index 6322987..f3083ff 100644 --- a/modules/gallery/show.html.erb +++ b/modules/gallery/show.html.erb @@ -7,7 +7,7 @@
- + {{alt_title}}

{{image-description}}