Skip to content

Commit f460e90

Browse files
committed
modify focus-visible style. Add button focus function
1 parent 1d80327 commit f460e90

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

css/redmond/2.1/jquery-ui.custom.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1231,4 +1231,6 @@ body .ui-tooltip {
12311231
height:1px;
12321232
position:absolute;
12331233
overflow:hidden;
1234-
}
1234+
}
1235+
1236+
:focus-visible { outline: 3px solid rgb(0, 4, 255); }

lib/glow/primitives.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3258,6 +3258,9 @@
32583258
attrs.background = value
32593259
$(attrs.jbutton).css({backgroundColor:rgb_to_css(attrs.background)})
32603260
},
3261+
focus: function() {
3262+
$(attrs.jbutton).focus()
3263+
},
32613264
remove: function() {
32623265
attrs.disabled = true
32633266
$(attrs.jbutton).attr('disabled', attrs.disabled)
@@ -3414,7 +3417,7 @@
34143417
function menu(args) {
34153418
if (!(this instanceof menu)) return new menu(args) // so menu() is like new menu()
34163419
var cvs = canvas.get_selected()
3417-
var attrs = {pos:cvs.caption_anchor, aria_label:"", selected:null, disabled:false}
3420+
var attrs = {pos:cvs.caption_anchor, aria_label:"", selected:null, disabled:false}
34183421
if (args.bind !== undefined) {
34193422
attrs.bind = args.bind
34203423
delete args.bind
@@ -3437,6 +3440,12 @@
34373440
if (cc === attrs.selected) s += '<option selected="selected">' + cc + '</option>\n'
34383441
else s += '<option>' + cc + '</option>\n'
34393442
}
3443+
for (a in attrs) {
3444+
if (args[a] !== undefined) {
3445+
attrs[a] = args[a]
3446+
delete args[a]
3447+
}
3448+
}
34403449
attrs.disabled = booleanize(attrs.disabled)
34413450
attrs.jmenu = $(`<select aria-label="${attrs.aria_label}">${s}</select>`).css("font-size","15px").change(function () {
34423451
attrs.bind(cmenu)

0 commit comments

Comments
 (0)