Skip to content

Commit 94caa16

Browse files
author
Alejandro Marques
committed
fix workspaces
1 parent 407a11b commit 94caa16

5 files changed

Lines changed: 15 additions & 45 deletions

File tree

src/App.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ li {
141141

142142
.secondary {
143143
color: white;
144+
padding-left: 0px!important;
145+
padding-right: 0px!important;
144146
}
145147

146148
.secondary p{

src/views/ViewA.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,18 +256,16 @@ class ViewA extends React.Component {
256256

257257
_renderWorkspaces = () => {
258258
let children = [];
259-
var os = require('os');
260259
console.log('plataforma: ',remote.process.platform);
261-
//alert(Object.keys(this.state.workSpaces).length);
262-
var text = remote.process.platform == 'darwin' ? 'cmd' : 'ctrl';
260+
var text = remote.process.platform === 'darwin' ? 'cmd' : 'ctrl';
263261
var i =1;
264262
globalShortcut.unregisterAll();
265263
for(let workspace in this.state.workSpaces){
266264
children.push(
267265
<ListItem className="bttn" key={workspace} >
268266
{/*<span style={{borderLeft: this.activeColor(workspace) === 1 ? '1px dotted white' : 'none'}}></span>*/}
269-
<div style={{backgroundImage: 'red', borderRadius: 8, borderLeft: this.activeColor(workspace) === 1 ? '6px solid #FF9735' : 'none', textAlign:'center'}}>
270-
<a onClick={() => {this.openWorkSpace(workspace)}} href="#/" style={{marginLeft: this.activeColor(workspace) === 1 ? '-6px': '0px'}}>
267+
<div style={{backgroundImage: 'red', borderRadius: 8, borderLeft: this.activeColor(workspace) === 1 ? '3px solid #FF9735' : 'none', textAlign:'center', width: this.activeColor(workspace) === 1 ? '69px' : '72px'}}>
268+
<a onClick={() => {this.openWorkSpace(workspace)}} href="#/" style={{marginLeft: this.activeColor(workspace) === 1 ? '-8px!important': 'none'}}>
271269
<Tooltip title={workspace} enterDelay={700} leaveDelay={200} placement="bottom">
272270
<img style={{opacity:this.activeColor(workspace), backgroundColor:'#FFFFFF'}} alt={workspace} className="workspace-img" src={this.getImageBase64(workspace)} />
273271
{/*this.getImageBase64(workspace)*/}

src/views/ViewB.js

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export default class ViewB extends React.Component {
138138
this['tab0'].addEventListener('dom-ready', ()=>{this.changeURL('tab0')});
139139
this['tab0'].addEventListener('context-menu', event => {
140140
console.log(event);
141-
if(event.params.mediaType == 'image'){
141+
if(event.params.mediaType === 'image'){
142142
console.log('Image URL: ', event.params.srcURL);
143143
}else{
144144
console.log('Link URL: ', event.params.linkURL);
@@ -249,12 +249,6 @@ export default class ViewB extends React.Component {
249249
}
250250
/* MENU */
251251

252-
/* LOAD IMAGE */
253-
loadImage = (image) => {
254-
var fr = new FileReader();
255-
}
256-
/* LOAD IMAGE */
257-
258252
/* APPBAR */
259253
reload = (ref) => {
260254
this[ref].reload();
@@ -377,9 +371,9 @@ export default class ViewB extends React.Component {
377371
var output = this.state.bookmarks.filter(
378372
(bookmarks) => {
379373
if(code.includes('http')){
380-
return bookmarks.url == code;
374+
return bookmarks.url === code;
381375
}else{
382-
return bookmarks.name == code;
376+
return bookmarks.name === code;
383377
}
384378
}
385379
);
@@ -398,9 +392,9 @@ export default class ViewB extends React.Component {
398392
var output = this.state.bookmarks.filter(
399393
(bookmarks) => {
400394
if(code.includes('http')){
401-
return bookmarks.url == code;
395+
return bookmarks.url === code;
402396
}else{
403-
return bookmarks.name == code;
397+
return bookmarks.name === code;
404398
}
405399
}
406400
);
@@ -421,7 +415,7 @@ export default class ViewB extends React.Component {
421415

422416
renderBookmarkList = (key) => {
423417
let children = [];
424-
if(typeof this.state.bookmarks === 'undefined' || this.state.bookmarks.length==0){
418+
if(typeof this.state.bookmarks === 'undefined' || this.state.bookmarks.length === 0){
425419
children.push(
426420
<MenuItem key={0} onClick={() => { this.handleBookmarkListClose()}}>No bookmarks saved</MenuItem>
427421
);
@@ -437,7 +431,6 @@ export default class ViewB extends React.Component {
437431
}
438432

439433
bookmarkOpen = (url) => {
440-
var activeTab = this.state.selectedTab;
441434
this[this.state.selectedTab ? this.state.selectedTab : 'tab0'].loadURL(url);
442435
this.handleBookmarkListClose();
443436
}

src/views/components/StarButton.js

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from 'react';
2-
import IconButton from '@material-ui/core/IconButton';
32
import Star from '@material-ui/icons/Star';
43
import StarBorder from '@material-ui/icons/StarBorder';
54

@@ -32,39 +31,16 @@ export default class StarButton extends React.Component {
3231
}
3332

3433
/* BOOKmARKS */
35-
/*
36-
getBookmark = (code) => {
37-
if(typeof code !== 'undefined'){
38-
39-
var output = this.state.bookmarks.filter(
40-
(bookmarks) => {
41-
if(code.includes('http')){
42-
return bookmarks.url == code;
43-
}else{
44-
return bookmarks.name == code;
45-
}
46-
}
47-
);
48-
if(code.includes('http')){
49-
return output.length >0? output[0].name : -1;
50-
}else{
51-
return output.length >0? output[0].url : -1;
52-
}
53-
}else{
54-
return -1;
55-
}
56-
}
57-
*/
5834
getIndexBookmark = (code) => {
5935
console.log(code);
6036

6137
if(typeof code !== 'undefined'){
6238
var output = this.state.bookmarks.filter(
6339
(bookmarks) => {
6440
if(code.includes('http')){
65-
return bookmarks.url == code;
41+
return bookmarks.url === code;
6642
}else{
67-
return bookmarks.name == code;
43+
return bookmarks.name === code;
6844
}
6945
}
7046
);

src/views/css/Views.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,5 @@
8080
.fullSpace{
8181
height: 85.3vh;
8282
}
83-
}
83+
}
84+

0 commit comments

Comments
 (0)