提交 33444b07 编写于 作者: J Joao Moreno

handle no readme. call super set input.

fixes #8830
上级 5bdc1451
......@@ -116,7 +116,6 @@ export class ExtensionEditor extends BaseEditor {
setInput(input: ExtensionsInput, options: EditorOptions): TPromise<void> {
this.transientDisposables = dispose(this.transientDisposables);
let promise = TPromise.as(null);
const extension = input.extension;
this.icon.style.backgroundImage = `url("${ extension.iconUrl }")`;
......@@ -152,10 +151,11 @@ export class ExtensionEditor extends BaseEditor {
this.transientDisposables.push(enableAction, updateAction, installAction);
this.body.innerHTML = '';
addClass(this.body, 'loading');
let promise: TPromise<any> = super.setInput(input, options);
if (extension.readmeUrl) {
promise = super.setInput(input, options)
promise = promise
.then(() => addClass(this.body, 'loading'))
.then(() => this.requestService.makeRequest({ url: extension.readmeUrl }))
.then(response => response.responseText)
.then(marked.parse)
......@@ -174,6 +174,10 @@ export class ExtensionEditor extends BaseEditor {
})
.then(null, () => null)
.then(() => removeClass(this.body, 'loading'));
} else {
promise = promise
.then(() => append(this.body, $('p')))
.then(p => p.textContent = localize('noReadme', "No README available."));
}
this.transientDisposables.push(toDisposable(() => promise.cancel()));
......
......@@ -103,4 +103,8 @@
.extension-editor > .body {
height: calc(100% - 168px);
overflow: hidden;
}
.extension-editor > .body > p {
margin: 20px;
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册