summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-08-04 19:42:52 +0200
committerJules Laplace <julescarbon@gmail.com>2020-08-04 19:42:52 +0200
commit371bbbb0a4dc3e6c44d3c4b91e330002c078cd78 (patch)
tree84787903cad65963e8139be53e49d1a0b441e17f
parent9e9d6dd6ee433d25516f4a686d58b764ef9abc1a (diff)
alt text
-rwxr-xr-xStoneIsland/config.xml2
-rwxr-xr-xStoneIsland/www/js/lib/blogs/BlogView.js6
-rwxr-xr-xStoneIsland/www/js/lib/blogs/HubView.js13
3 files changed, 16 insertions, 5 deletions
diff --git a/StoneIsland/config.xml b/StoneIsland/config.xml
index 2bcce4f2..db35926a 100755
--- a/StoneIsland/config.xml
+++ b/StoneIsland/config.xml
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
-<widget android-versionCode="6134" id="us.okfoc.stoneisland" version="1.3.4" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+<widget android-versionCode="6135" id="us.okfoc.stoneisland" version="1.3.5" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Stone Island</name>
<description>
Stone Island
diff --git a/StoneIsland/www/js/lib/blogs/BlogView.js b/StoneIsland/www/js/lib/blogs/BlogView.js
index 9190634c..d37846c2 100755
--- a/StoneIsland/www/js/lib/blogs/BlogView.js
+++ b/StoneIsland/www/js/lib/blogs/BlogView.js
@@ -61,9 +61,11 @@ var BlogView = View.extend({
}
else {
app.departments = app.store.Departments
- app.department_id = app.store.Departments[0].uri
+ if (app.store.Departments.length) {
+ app.department_id = app.store.Departments[0].uri
+ app.collection.setCollectionName( app.store.Departments[0].text )
+ }
$("#collections h1").toggleClass("single-dept", app.store.Departments.length == 1)
- app.collection.setCollectionName( app.store.Departments[0].text )
//// demo department for shoes with weird SizeTypeId
// app.department_id = "NKDrtSC"
if (sdk.env === 'test') {
diff --git a/StoneIsland/www/js/lib/blogs/HubView.js b/StoneIsland/www/js/lib/blogs/HubView.js
index 0d59bcc8..30339948 100755
--- a/StoneIsland/www/js/lib/blogs/HubView.js
+++ b/StoneIsland/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(/\"?\)/,"")