Skip to content

Commit f33288f

Browse files
committed
Static
1 parent 4ea0274 commit f33288f

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/controller.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
function player(file) {
2727
susresBtn.textContent = 'Loading'
28+
susresBtn.classList.add('disabled')
2829
let paused = false
2930
let source, startedAt, pausedAt, currentBuffer, length, played
3031
const audioCtx = new AudioContext()

src/extension.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ const path = require('path')
88
* @param {vscode.ExtensionContext} context
99
*/
1010
function activate(context) {
11-
const specTV = new tv.Treeview(context)
12-
13-
specTV.specExplorer.onDidChangeSelection(file => {
11+
const specExplorer = tv.Treeview.create(context)
12+
specExplorer.onDidChangeSelection(file => {
1413
try { file.selection[0].fullFilePath }
1514
catch (error) {
1615
vscode.window.showInformationMessage('Slow down 😵')

src/treeview.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ const path = require('path')
44
const fs = require('fs')
55

66
class Treeview {
7-
constructor(context) {
7+
static create(context) {
88
const specTreeDataProvider = new SpecTreeDataProvider(vscode.workspace.workspaceFolders[0].uri.fsPath)
99
context.subscriptions.push(vscode.workspace.registerTextDocumentContentProvider('spec', specTreeDataProvider))
10-
this.specExplorer = vscode.window.createTreeView('spec-explorer', { treeDataProvider: specTreeDataProvider, showCollapseAll: true })
10+
return vscode.window.createTreeView('spec-explorer', { treeDataProvider: specTreeDataProvider, showCollapseAll: true })
1111
}
1212
}
1313

@@ -41,7 +41,7 @@ class SpecTreeDataProvider {
4141

4242
// ??
4343
provideTextDocumentContent(uri, token) {
44-
return uri+token
44+
return uri + token
4545
}
4646

4747
getFiles(thePath) {
@@ -98,4 +98,3 @@ class fileItem extends vscode.TreeItem {
9898
}
9999

100100
exports.Treeview = Treeview
101-
exports.fileItem = fileItem

0 commit comments

Comments
 (0)