diff --git a/App/Resources/RenderView.js b/App/Resources/RenderView.js index be9baec7f..e5773ccf8 100644 --- a/App/Resources/RenderView.js +++ b/App/Resources/RenderView.js @@ -1611,6 +1611,23 @@ Awful.setShowAvatars = function(showAvatars) { }; +/** + Toggles aria-hidden on post metadata so iOS Spoken Content / VoiceOver skips usernames, regdates, and post dates. + + @param {boolean} hide - `true` to mark the post header and post date as aria-hidden, `false` to restore them. + */ +Awful.setHidePostMetadataForReader = function(hide) { + var els = document.querySelectorAll('post > header, post > footer'); + Array.prototype.forEach.call(els, function(el) { + if (hide) { + el.setAttribute('aria-hidden', 'true'); + } else { + el.removeAttribute('aria-hidden'); + } + }); +}; + + /** Updates the stylesheet for the currently-selected theme. diff --git a/App/Templates/Post.html.stencil b/App/Templates/Post.html.stencil index 2c41feb82..bfe40a3db 100644 --- a/App/Templates/Post.html.stencil +++ b/App/Templates/Post.html.stencil @@ -7,6 +7,7 @@