summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-08-31 23:07:20 +0200
committerJules Laplace <julescarbon@gmail.com>2020-08-31 23:07:20 +0200
commit22721a013bdd10d5eb395ba18453585f5f3f1f7f (patch)
tree5a920e31d6026ed5dc55265e5fd057febccc50e3 /StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js
parentd22d51a1ae49680015326857360eb699f31efced (diff)
rebuild the ios platform and the plugins
Diffstat (limited to 'StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js')
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/blogs/HubView.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js b/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js
index 0d59bcc8..7a6f17d9 100755
--- a/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js
@@ -70,6 +70,7 @@ var HubView = ScrollableView.extend({
if (row.image && row.image.length > 1) {
// image gallery
var $gallery = $(".gallery-" + row.id)
+ var default_title = stonewash(row.title) + ". Image gallery, use the arrows to scroll."
row.image.forEach(function(img){
var el = document.createElement("div")
el.style.backgroundImage = "url(" + img.uri + ")"
@@ -93,9 +94,17 @@ var HubView = ScrollableView.extend({
var url = gallery.selectedElement.style.backgroundImage.replace(/url\(\"?/,"").replace(/\"?\)/,"")
app.fullscreenViewer.show(url, url, stonewash(row.title))
})
- $(".gallery-" + row.id).attr('aria-label', stonewash(row.title) + ". Image gallery, use the arrows to scroll.")
+ gallery.on('settle', function(e){
+ // console.log(".gallery-target-" + row.id)
+ var currentImage = gallery.selectedElement
+ var title = $(currentImage).get(0).getAttribute('aria-label') || default_title
+ $(".gallery-" + row.id).attr('aria-label', title)
+ $(".gallery-target-" + row.id).attr('aria-label', title)
+ })
+ var current_title = row.image[0].caption || default_title
+ $(".gallery-" + row.id).attr('aria-label', current_title)
if (accessibility.voiceOver) {
- $(".gallery-target-" + row.id).attr('aria-label', stonewash(row.title) + ". Image gallery, use the arrows to scroll.")
+ $(".gallery-target-" + row.id).attr('aria-label', current_title)
$(".gallery-target-" + row.id).click(function(e){
e && e.preventDefault()
var url = gallery.selectedElement.style.backgroundImage.replace(/url\(\"?/,"").replace(/\"?\)/,"")