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
e784b2ae
Commit
e784b2ae
authored
Aug 24, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move optimize to settings tab
parent
30612fc4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
11 deletions
+22
-11
app.js
src/app.js
+4
-11
settings-tab.js
src/app/tabs/settings-tab.js
+18
-0
No files found.
src/app.js
View file @
e784b2ae
...
@@ -594,6 +594,10 @@ function run () {
...
@@ -594,6 +594,10 @@ function run () {
},
},
resetDapp
:
(
contracts
)
=>
{
resetDapp
:
(
contracts
)
=>
{
udapp
.
reset
(
contracts
,
transactionContextAPI
)
udapp
.
reset
(
contracts
,
transactionContextAPI
)
},
setOptimize
:
(
optimize
,
runCompilation
)
=>
{
compiler
.
setOptimize
(
optimize
)
if
(
runCompilation
)
runCompiler
()
}
}
}
}
var
rhpEvents
=
{
var
rhpEvents
=
{
...
@@ -1014,17 +1018,6 @@ function run () {
...
@@ -1014,17 +1018,6 @@ function run () {
}
}
}
}
// set default
$
(
'#optimize'
).
attr
(
'checked'
,
(
queryParams
.
get
().
optimize
===
'true'
))
compiler
.
setOptimize
(
document
.
querySelector
(
'#optimize'
).
checked
)
document
.
querySelector
(
'#optimize'
).
addEventListener
(
'change'
,
function
()
{
var
optimize
=
document
.
querySelector
(
'#optimize'
).
checked
queryParams
.
update
({
optimize
:
optimize
})
compiler
.
setOptimize
(
optimize
)
runCompiler
()
})
// ----------------- version selector-------------
// ----------------- version selector-------------
// clear and disable the version selector
// clear and disable the version selector
...
...
src/app/tabs/settings-tab.js
View file @
e784b2ae
var
yo
=
require
(
'yo-yo'
)
var
yo
=
require
(
'yo-yo'
)
var
QueryParams
=
require
(
'../../lib/query-params'
)
// -------------- styling ----------------------
// -------------- styling ----------------------
var
csjs
=
require
(
'csjs-inject'
)
var
csjs
=
require
(
'csjs-inject'
)
...
@@ -28,6 +29,8 @@ function SettingsTab (container, appAPI, appEvents, opts) {
...
@@ -28,6 +29,8 @@ function SettingsTab (container, appAPI, appEvents, opts) {
if
(
typeof
container
===
'string'
)
container
=
document
.
querySelector
(
container
)
if
(
typeof
container
===
'string'
)
container
=
document
.
querySelector
(
container
)
if
(
!
container
)
throw
new
Error
(
'no container given'
)
if
(
!
container
)
throw
new
Error
(
'no container given'
)
var
queryParams
=
new
QueryParams
()
var
el
=
yo
`
var
el
=
yo
`
<div class="
${
css
.
settingsTabView
}
"id="settingsView">
<div class="
${
css
.
settingsTabView
}
"id="settingsView">
<div class="
${
css
.
info
}
">
<div class="
${
css
.
info
}
">
...
@@ -47,5 +50,20 @@ function SettingsTab (container, appAPI, appEvents, opts) {
...
@@ -47,5 +50,20 @@ function SettingsTab (container, appAPI, appEvents, opts) {
</div>
</div>
</div>
</div>
`
`
var
optimize
=
el
.
querySelector
(
'#optimize'
)
if
((
queryParams
.
get
().
optimize
===
'true'
))
{
optimize
.
setAttribute
(
'checked'
,
true
)
appAPI
.
setOptimize
(
true
,
false
)
}
else
{
appAPI
.
setOptimize
(
false
,
false
)
}
optimize
.
addEventListener
(
'change'
,
function
()
{
var
optimize
=
this
.
checked
queryParams
.
update
({
optimize
:
optimize
})
appAPI
.
setOptimize
(
optimize
,
true
)
})
container
.
appendChild
(
el
)
container
.
appendChild
(
el
)
}
}
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