Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
旅途_2012
vscode
提交
7e8371c4
V
vscode
项目概览
旅途_2012
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7e8371c4
编写于
7月 06, 2018
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #52452
上级
d1f8ff61
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
33 addition
and
6 deletion
+33
-6
src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts
.../workbench/parts/preferences/browser/keybindingsEditor.ts
+23
-3
src/vs/workbench/parts/preferences/browser/preferencesEditor.ts
.../workbench/parts/preferences/browser/preferencesEditor.ts
+2
-1
src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts
...workbench/parts/preferences/browser/preferencesWidgets.ts
+6
-1
src/vs/workbench/parts/preferences/browser/settingsEditor2.ts
...vs/workbench/parts/preferences/browser/settingsEditor2.ts
+2
-1
未找到文件。
src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts
浏览文件 @
7e8371c4
...
...
@@ -74,6 +74,8 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
private
searchFocusContextKey
:
IContextKey
<
boolean
>
;
private
sortByPrecedence
:
Checkbox
;
private
ariaLabelElement
:
HTMLElement
;
constructor
(
@
ITelemetryService
telemetryService
:
ITelemetryService
,
@
IThemeService
themeService
:
IThemeService
,
...
...
@@ -100,6 +102,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
createEditor
(
parent
:
HTMLElement
):
void
{
const
keybindingsEditorElement
=
DOM
.
append
(
parent
,
$
(
'
div
'
,
{
class
:
'
keybindings-editor
'
}));
this
.
createAriaLabelElement
(
keybindingsEditorElement
);
this
.
createOverlayContainer
(
keybindingsEditorElement
);
this
.
createHeader
(
keybindingsEditorElement
);
this
.
createBody
(
keybindingsEditorElement
);
...
...
@@ -268,6 +271,12 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
return
TPromise
.
as
(
null
);
}
private
createAriaLabelElement
(
parent
:
HTMLElement
):
void
{
this
.
ariaLabelElement
=
DOM
.
append
(
parent
,
DOM
.
$
(
''
));
this
.
ariaLabelElement
.
setAttribute
(
'
id
'
,
'
keybindings-editor-aria-label-element
'
);
this
.
ariaLabelElement
.
setAttribute
(
'
aria-live
'
,
'
assertive
'
);
}
private
createOverlayContainer
(
parent
:
HTMLElement
):
void
{
this
.
overlayContainer
=
DOM
.
append
(
parent
,
$
(
'
.overlay-container
'
));
this
.
overlayContainer
.
style
.
position
=
'
absolute
'
;
...
...
@@ -293,7 +302,8 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
this
.
searchWidget
=
this
.
_register
(
this
.
instantiationService
.
createInstance
(
SearchWidget
,
searchContainer
,
{
ariaLabel
:
localize
(
'
SearchKeybindings.AriaLabel
'
,
"
Search keybindings
"
),
placeholder
:
localize
(
'
SearchKeybindings.Placeholder
'
,
"
Search keybindings
"
),
focusKey
:
this
.
searchFocusContextKey
focusKey
:
this
.
searchFocusContextKey
,
ariaLabelledBy
:
'
keybindings-editor-aria-label-element
'
}));
this
.
_register
(
this
.
searchWidget
.
onDidChange
(
searchValue
=>
this
.
delayedFiltering
.
trigger
(()
=>
this
.
filterKeybindings
())));
...
...
@@ -302,8 +312,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
isChecked
:
false
,
title
:
localize
(
'
sortByPrecedene
'
,
"
Sort by Precedence
"
)
}));
this
.
_register
(
this
.
sortByPrecedence
.
onChange
(()
=>
this
.
renderKeybindingsEntries
(
false
)));
this
.
_register
(
this
.
sortByPrecedence
.
onChange
(()
=>
this
.
renderKeybindingsEntries
(
false
)));
searchContainer
.
appendChild
(
this
.
sortByPrecedence
.
domNode
);
this
.
createOpenKeybindingsElement
(
this
.
headerContainer
);
...
...
@@ -397,6 +406,9 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
if
(
this
.
keybindingsEditorModel
)
{
const
filter
=
this
.
searchWidget
.
getValue
();
const
keybindingsEntries
:
IKeybindingItemEntry
[]
=
this
.
keybindingsEditorModel
.
fetch
(
filter
,
this
.
sortByPrecedence
.
checked
);
this
.
ariaLabelElement
.
setAttribute
(
'
aria-label
'
,
this
.
getAriaLabel
());
if
(
keybindingsEntries
.
length
===
0
)
{
this
.
latestEmptyFilters
.
push
(
filter
);
}
...
...
@@ -425,6 +437,14 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
}
}
private
getAriaLabel
():
string
{
if
(
this
.
sortByPrecedence
.
checked
)
{
return
localize
(
'
show sorted keybindings
'
,
"
Showing Keybindings in precendence order
"
);
}
else
{
return
localize
(
'
show keybindings
'
,
"
Showing Keybindings in alphabetical order
"
);
}
}
private
layoutKebindingsList
():
void
{
const
listHeight
=
this
.
dimension
.
height
-
(
DOM
.
getDomNodePagePosition
(
this
.
headerContainer
).
height
+
12
/*padding*/
);
this
.
keybindingsListContainer
.
style
.
height
=
`
${
listHeight
}
px`
;
...
...
src/vs/workbench/parts/preferences/browser/preferencesEditor.ts
浏览文件 @
7e8371c4
...
...
@@ -126,7 +126,8 @@ export class PreferencesEditor extends BaseEditor {
ariaLabel
:
nls
.
localize
(
'
SearchSettingsWidget.AriaLabel
'
,
"
Search settings
"
),
placeholder
:
nls
.
localize
(
'
SearchSettingsWidget.Placeholder
'
,
"
Search Settings
"
),
focusKey
:
this
.
searchFocusContextKey
,
showResultCount
:
true
showResultCount
:
true
,
ariaLive
:
'
assertive
'
}));
this
.
_register
(
this
.
searchWidget
.
onDidChange
(
value
=>
this
.
onInputChanged
()));
this
.
_register
(
this
.
searchWidget
.
onFocus
(()
=>
this
.
lastFocusedWidget
=
this
.
searchWidget
));
...
...
src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts
浏览文件 @
7e8371c4
...
...
@@ -561,6 +561,8 @@ export class SettingsTargetsWidget extends Widget {
export
interface
SearchOptions
extends
IInputOptions
{
focusKey
?:
IContextKey
<
boolean
>
;
showResultCount
?:
boolean
;
ariaLive
?:
string
;
ariaLabelledBy
?:
string
;
}
export
class
SearchWidget
extends
Widget
{
...
...
@@ -608,7 +610,10 @@ export class SearchWidget extends Widget {
}));
}
this
.
inputBox
.
inputElement
.
setAttribute
(
'
aria-live
'
,
'
assertive
'
);
this
.
inputBox
.
inputElement
.
setAttribute
(
'
aria-live
'
,
this
.
options
.
ariaLive
||
'
off
'
);
if
(
this
.
options
.
ariaLabelledBy
)
{
this
.
inputBox
.
inputElement
.
setAttribute
(
'
aria-labelledBy
'
,
this
.
options
.
ariaLabelledBy
);
}
const
focusTracker
=
this
.
_register
(
DOM
.
trackFocus
(
this
.
inputBox
.
inputElement
));
this
.
_register
(
focusTracker
.
onDidFocus
(()
=>
this
.
_onFocus
.
fire
()));
...
...
src/vs/workbench/parts/preferences/browser/settingsEditor2.ts
浏览文件 @
7e8371c4
...
...
@@ -189,7 +189,8 @@ export class SettingsEditor2 extends BaseEditor {
this
.
searchWidget
=
this
.
_register
(
this
.
instantiationService
.
createInstance
(
SearchWidget
,
searchContainer
,
{
ariaLabel
:
localize
(
'
SearchSettings.AriaLabel
'
,
"
Search settings
"
),
placeholder
:
localize
(
'
SearchSettings.Placeholder
'
,
"
Search settings
"
),
focusKey
:
this
.
searchFocusContextKey
focusKey
:
this
.
searchFocusContextKey
,
ariaLive
:
'
assertive
'
}));
this
.
_register
(
this
.
searchWidget
.
onDidChange
(()
=>
this
.
onSearchInputChanged
()));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录