Skip to content

Commit 23a8d9f

Browse files
committed
add aria_hidden attribute for wtext objects.
1 parent 84bf43e commit 23a8d9f

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

docker-datastore.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "2"
2-
31
#
42
# This compose file is just for running the datastore locally.
53
#

lib/glow/primitives.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3061,7 +3061,7 @@
30613061
if (!(this instanceof wtext)) return new wtext(args) // so wtext() is like new wtext()
30623062
args = args || {}
30633063
var cvs = canvas.get_selected()
3064-
var attrs = {pos:cvs.caption_anchor, text:'', hidden:false}
3064+
var attrs = {pos:cvs.caption_anchor, text:'', hidden:false, aria_hidden:false}
30653065
for (var a in attrs) {
30663066
if (args[a] !== undefined) {
30673067
attrs[a] = args[a]
@@ -3070,7 +3070,7 @@
30703070
}
30713071
widgetid++
30723072
attrs._id = widgetid.toString()
3073-
$(`<span id=${attrs._id} ${attrs.hidden ? 'class="visually-hidden" aria-live="assertive"' : ''}>${print_to_string(attrs.text)}</span>`).appendTo(attrs.pos)
3073+
$(`<span id=${attrs._id} ${attrs.hidden ? 'class="visually-hidden" aria-live="assertive"' : ''} ${attrs.aria_hidden? 'aria-hidden="true"':''}>${print_to_string(attrs.text)}</span>`).appendTo(attrs.pos)
30743074

30753075
var cwtext = { // this structure implements a JavaScript "closure", essential for wtext to work
30763076
get text() {return attrs.text},

0 commit comments

Comments
 (0)