fixed fil-open icon and change the style of icons

pull/1/head
LianaHus 6 years ago
parent a007399adc
commit 416d7906e9
  1. 10
      src/app/files/file-explorer.js
  2. 7
      src/app/files/styles/file-explorer-styles.js

@ -63,6 +63,8 @@ function fileExplorer (localRegistry, files, menuItems) {
fileManager: self._components.registry.get('filemanager').api fileManager: self._components.registry.get('filemanager').api
} }
self._components.registry.put({ api: self, name: `fileexplorer/${self.files.type}` })
// warn if file changed outside of Remix // warn if file changed outside of Remix
function remixdDialog () { function remixdDialog () {
return yo`<div>This file has been changed outside of Remix IDE.</div>` return yo`<div>This file has been changed outside of Remix IDE.</div>`
@ -507,7 +509,7 @@ fileExplorer.prototype.renderMenuItems = function () {
items = this.menuItems.map(({action, title, icon}) => { items = this.menuItems.map(({action, title, icon}) => {
if (action === 'uploadFile') { if (action === 'uploadFile') {
return yo` return yo`
<label class="${icon} ${css.newFile}"> <label class="${icon} ${css.newFile}" title="${title}">
<input type="file" onchange=${(event) => { <input type="file" onchange=${(event) => {
event.stopPropagation() event.stopPropagation()
this.uploadFile(event) this.uploadFile(event)
@ -516,14 +518,12 @@ fileExplorer.prototype.renderMenuItems = function () {
` `
} else { } else {
return yo` return yo`
<span onclick=${(event) => { event.stopPropagation(); this[ action ]() }} class="newFile ${css.newFile}" title=${title}> <span onclick=${(event) => { event.stopPropagation(); this[ action ]() }} class="${icon} ${css.newFile}" title=${title}></span>
<i class=${icon}></i>
</span>
` `
} }
}) })
} }
return yo`<span class=${css.menu}>${items}</span>` return yo`<span class=" ${css.menu}">${items}</span>`
} }
fileExplorer.prototype.ensureRoot = function (cb) { fileExplorer.prototype.ensureRoot = function (cb) {

@ -3,6 +3,7 @@ var csjs = require('csjs-inject')
var css = csjs` var css = csjs`
.label { .label {
margin-bottom : 0px; margin-bottom : 0px;
margin-top : 4px
} }
.fileexplorer { .fileexplorer {
box-sizing : border-box; box-sizing : border-box;
@ -19,13 +20,13 @@ var css = csjs`
padding : 4px; padding : 4px;
} }
.newFile { .newFile {
padding : 4px; padding : 5px;
} }
.newFile i { .newFile i {
cursor : pointer; cursor : pointer;
} }
.newFile i:hover { .newFile:hover {
color : var(--secondary) transform : scale(1.3);
} }
.menu { .menu {
margin-left : 20px; margin-left : 20px;

Loading…
Cancel
Save