提交 d7d749b6 编写于 作者: C Christof Marti

Add 'more' to the Recent section (fixes #25583)

上级 d4f3981b
......@@ -32,6 +32,7 @@ export default () => `
<h2>${escape(localize('welcomePage.recent', "Recent"))}</h2>
<ul class="list">
<!-- Filled programmatically -->
<li class="moreRecent"><a href="command:workbench.action.openRecent">${escape(localize('welcomePage.moreRecent', "More..."))}</a><span class="path if_shortcut" data-command="workbench.action.openRecent">(<span class="shortcut" data-command="workbench.action.openRecent"></span>)</span></li>
</ul>
<p class="none">${escape(localize('welcomePage.noRecentFolders', "No recent folders"))}</p>
</div>
......
......@@ -138,6 +138,10 @@
display: initial;
}
.monaco-workbench > .part.editor > .content .welcomePage .splash .recent li.moreRecent {
margin-top: 5px;
}
.monaco-workbench > .part.editor > .content .welcomePage .splash .recent li {
min-width: 0;
white-space: nowrap;
......
......@@ -160,6 +160,7 @@ class WelcomePage {
return;
}
const ul = container.querySelector('.recent ul');
const before = ul.firstElementChild;
folders.slice(0, 5).forEach(folder => {
const li = document.createElement('li');
......@@ -191,7 +192,7 @@ class WelcomePage {
span.title = folder;
li.appendChild(span);
ul.appendChild(li);
ul.insertBefore(li, before);
});
}).then(null, onUnexpectedError);
......
......@@ -309,6 +309,7 @@ export class WalkThroughPart extends BaseEditor {
this.content.innerHTML = content;
this.updateSizeClasses();
this.decorateContent();
this.contentDisposables.push(this.keybindingService.onDidUpdateKeybindings(() => this.decorateContent()));
if (input.onReady) {
input.onReady(this.content.firstElementChild as HTMLElement);
}
......@@ -447,9 +448,19 @@ export class WalkThroughPart extends BaseEditor {
const command = key.getAttribute('data-command');
const keybinding = command && this.keybindingService.lookupKeybinding(command);
const label = keybinding ? keybinding.getLabel() : UNBOUND_COMMAND;
while (key.firstChild) {
key.removeChild(key.firstChild);
}
key.appendChild(document.createTextNode(label));
});
const ifkeys = this.content.querySelectorAll('.if_shortcut[data-command]');
Array.prototype.forEach.call(ifkeys, (key: HTMLElement) => {
const command = key.getAttribute('data-command');
const keybinding = command && this.keybindingService.lookupKeybinding(command);
key.style.display = !keybinding ? 'none' : '';
});
}
private saveTextEditorViewState(resource: URI): void {
const memento = this.getMemento(this.storageService, Scope.WORKSPACE);
let editorViewStateMemento = memento[WALK_THROUGH_EDITOR_VIEW_STATE_PREFERENCE_KEY];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册