Skip to content

Commit

Permalink
treview indent
Browse files Browse the repository at this point in the history
remixD error report
  • Loading branch information
LianaHus committed Jul 7, 2020
1 parent 1c6f510 commit 44bf552
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
11 changes: 9 additions & 2 deletions src/app/files/remixd-handle.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var css = csjs`

const profile = {
name: 'remixd',
displayName: 'RemixD',
url: 'ws://127.0.0.1:65520',
methods: ['folderIsReadOnly', 'resolveDirectory', 'get', 'exists', 'isFile', 'set', 'rename', 'remove', 'isDirectory', 'list'],
events: [],
Expand Down Expand Up @@ -57,7 +58,7 @@ export class RemixdHandle extends WebsocketPlugin {
* connect to localhost if no connection and render the explorer
* disconnect from localhost if connected and remove the explorer
*
* @param {String} txHash - hash of the transaction
* @param {String} txHash - hash of the transaction
*/
async connectToLocalhost () {
let connection = (error) => {
Expand All @@ -83,7 +84,13 @@ export class RemixdHandle extends WebsocketPlugin {
fn: () => {
try {
super.activate()
setTimeout(() => { connection() }, 2000)
setTimeout(() => {
if (!super.socket) {
connection(new Error('Connection with daemon failed.'))
} else {
connection()
}
}, 3000)
} catch (error) {
connection(error)
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/panels/file-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ module.exports = class Filepanel extends ViewPlugin {
const explorers = yo`
<div>
<div class="pl-2 ${css.treeview}" data-id="filePanelFileExplorerTree">${fileExplorer.init()}</div>
<div class="filesystemexplorer ${css.treeview}">${fileSystemExplorer.init()}</div>
<div class="pl-2 filesystemexplorer ${css.treeview}">${fileSystemExplorer.init()}</div>
</div>
`

Expand Down
6 changes: 3 additions & 3 deletions src/app/ui/TreeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ class TreeView {
var children = Object.keys(json).map((innerkey) => {
return this.renderObject(json[innerkey], json, innerkey, expand, innerkey)
})
return yo`<ul key=${key} data-id="treeViewUl${key}" class="${css.ul_tv} ml-0 pr-2">${children}</ul>`
return yo`<ul key=${key} data-id="treeViewUl${key}" class="${css.ul_tv} ml-0 px-2">${children}</ul>`
}

formatData (key, data, children, expand, keyPath) {
var self = this
var li = yo`<li key=${keyPath} data-id="treeViewLi${keyPath}" class=${css.li_tv}></li>`
var caret = yo`<div class="fas fa-caret-right caret ${css.caret_tv}"></div>`
var caret = yo`<div class="px-1 fas fa-caret-right caret ${css.caret_tv}"></div>`
var label = yo`
<div key=${keyPath} data-id="treeViewDiv${keyPath}" class="d-flex flex-row align-items-center">
${caret}
Expand All @@ -95,7 +95,7 @@ class TreeView {
const expanded = self.expandPath.includes(keyPath)
li.appendChild(label)
if (data.children) {
var list = yo`<ul key=${keyPath} data-id="treeViewUlList${keyPath}" class=${css.ul_tv}>${children}</ul>`
var list = yo`<ul key=${keyPath} data-id="treeViewUlList${keyPath}" class="pl-2 ${css.ul_tv}">${children}</ul>`
list.style.display = expanded ? 'block' : 'none'
caret.className = list.style.display === 'none' ? `fas fa-caret-right caret ${css.caret_tv}` : `fas fa-caret-down caret ${css.caret_tv}`
caret.setAttribute('data-id', `treeViewToggle${keyPath}`)
Expand Down

0 comments on commit 44bf552

Please sign in to comment.