Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
2feda567
Unverified
Commit
2feda567
authored
May 20, 2019
by
yann300
Committed by
GitHub
May 20, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1987 from ethereum/master_l
listen to PersonalMode changed event for Add Account ui updates
parents
4a4852f4
fc8e43e2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
9 deletions
+21
-9
settings.js
src/app/tabs/runTab/settings.js
+18
-9
config.js
src/config.js
+3
-0
No files found.
src/app/tabs/runTab/settings.js
View file @
2feda567
...
@@ -24,9 +24,12 @@ class SettingsUI {
...
@@ -24,9 +24,12 @@ class SettingsUI {
this
.
_components
.
registry
=
globalRegistry
this
.
_components
.
registry
=
globalRegistry
this
.
_deps
=
{
this
.
_deps
=
{
networkModule
:
this
.
_components
.
registry
.
get
(
'network'
).
api
networkModule
:
this
.
_components
.
registry
.
get
(
'network'
).
api
,
config
:
this
.
_components
.
registry
.
get
(
'config'
).
api
}
}
this
.
_deps
.
config
.
events
.
on
(
'settings/personal-mode_changed'
,
this
.
onPersonalChange
.
bind
(
this
))
setInterval
(()
=>
{
setInterval
(()
=>
{
this
.
updateAccountBalances
()
this
.
updateAccountBalances
()
},
10
*
1000
)
},
10
*
1000
)
...
@@ -87,7 +90,7 @@ class SettingsUI {
...
@@ -87,7 +90,7 @@ class SettingsUI {
<div class="
${
css
.
crow
}
">
<div class="
${
css
.
crow
}
">
<div class="
${
css
.
col1_1
}
">
<div class="
${
css
.
col1_1
}
">
Account
Account
<span id="remixRunPlusWraper" title="Create a new account">
<span id="remixRunPlusWraper" title="Create a new account"
onload=
${
this
.
updatePlusButton
.
bind
(
this
)}
>
<i id="remixRunPlus" class="fas fa-plus-circle
${
css
.
icon
}
" aria-hidden="true" onclick=
${
this
.
newAccount
.
bind
(
this
)}
"></i>
<i id="remixRunPlus" class="fas fa-plus-circle
${
css
.
icon
}
" aria-hidden="true" onclick=
${
this
.
newAccount
.
bind
(
this
)}
"></i>
</span>
</span>
</div>
</div>
...
@@ -215,19 +218,25 @@ class SettingsUI {
...
@@ -215,19 +218,25 @@ class SettingsUI {
}
}
break
break
case
'web3'
:
{
case
'web3'
:
{
if
(
!
this
.
_components
.
registry
.
get
(
'config'
).
api
.
get
(
'settings/personal-mode'
))
{
this
.
onPersonalChange
()
plusBtn
.
classList
.
add
(
css
.
disableMouseEvents
)
plusTitle
.
title
=
'Creating an account is possible only in Personal mode. Please go to Settings to enable it.'
}
else
{
plusBtn
.
classList
.
remove
(
css
.
disableMouseEvents
)
plusTitle
.
title
=
'Create a new account'
}
}
}
break
break
default
:
default
:
}
}
}
}
onPersonalChange
()
{
let
plusBtn
=
document
.
getElementById
(
'remixRunPlus'
)
let
plusTitle
=
document
.
getElementById
(
'remixRunPlusWraper'
)
if
(
!
this
.
_deps
.
config
.
get
(
'settings/personal-mode'
))
{
plusBtn
.
classList
.
add
(
css
.
disableMouseEvents
)
plusTitle
.
title
=
'Creating an account is possible only in Personal mode. Please go to Settings to enable it.'
}
else
{
plusBtn
.
classList
.
remove
(
css
.
disableMouseEvents
)
plusTitle
.
title
=
'Create a new account'
}
}
newAccount
()
{
newAccount
()
{
this
.
settings
.
newAccount
(
this
.
settings
.
newAccount
(
(
cb
)
=>
{
(
cb
)
=>
{
...
...
src/config.js
View file @
2feda567
'use strict'
'use strict'
var
CONFIG_FILE
=
'.remix.config'
var
CONFIG_FILE
=
'.remix.config'
const
EventEmitter
=
require
(
'events'
)
function
Config
(
storage
)
{
function
Config
(
storage
)
{
this
.
items
=
{}
this
.
items
=
{}
this
.
unpersistedItems
=
{}
this
.
unpersistedItems
=
{}
this
.
events
=
new
EventEmitter
()
// load on instantiation
// load on instantiation
try
{
try
{
...
@@ -28,6 +30,7 @@ function Config (storage) {
...
@@ -28,6 +30,7 @@ function Config (storage) {
this
.
items
[
key
]
=
content
this
.
items
[
key
]
=
content
try
{
try
{
storage
.
set
(
CONFIG_FILE
,
JSON
.
stringify
(
this
.
items
))
storage
.
set
(
CONFIG_FILE
,
JSON
.
stringify
(
this
.
items
))
this
.
events
.
emit
(
key
+
'_changed'
,
content
)
}
catch
(
exception
)
{
}
catch
(
exception
)
{
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment