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
fd2bf3ad
Commit
fd2bf3ad
authored
Jul 18, 2017
by
Alexander Praetorius
Committed by
GitHub
Jul 18, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12 from ethereum/serapathMaster
add init function to righthandpanel && use appendChild instead of replaceWith && righthandpanel.init()
parents
9ede4ece
6650076c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
60 deletions
+60
-60
app.js
src/app.js
+2
-1
righthand-panel.js
src/app/righthand-panel.js
+58
-59
No files found.
src/app.js
View file @
fd2bf3ad
...
@@ -708,7 +708,8 @@ function run () {
...
@@ -708,7 +708,8 @@ function run () {
udapp
:
udapp
.
event
udapp
:
udapp
.
event
}
}
var
righthandPanel
=
new
RighthandPanel
(
rhpAPI
,
rhpEvents
,
{})
// eslint-disable-line
var
righthandPanel
=
new
RighthandPanel
(
rhpAPI
,
rhpEvents
,
{})
// eslint-disable-line
self
.
_view
.
rightpanel
.
replaceWith
(
righthandPanel
.
render
())
self
.
_view
.
rightpanel
.
appendChild
(
righthandPanel
.
render
())
righthandPanel
.
init
()
// ----------------- editor resize ---------------
// ----------------- editor resize ---------------
...
...
src/app/righthand-panel.js
View file @
fd2bf3ad
...
@@ -60,71 +60,70 @@ function RighthandPanel (appAPI, events, opts) {
...
@@ -60,71 +60,70 @@ function RighthandPanel (appAPI, events, opts) {
self
.
render
=
function
()
{
return
element
}
self
.
render
=
function
()
{
return
element
}
;[...
options
.
children
].
forEach
((
el
)
=>
{
el
.
classList
.
add
(
css
.
options
)
})
self
.
init
=
function
()
{
;[...
options
.
children
].
forEach
((
el
)
=>
{
el
.
classList
.
add
(
css
.
options
)
})
// ----------------- toggle right hand panel -----------------
// ----------------- toggle right hand panel -----------------
var
hidingRHP
=
false
var
hidingRHP
=
false
$
(
'.toggleRHP'
).
click
(
function
()
{
$
(
'.toggleRHP'
).
click
(
function
()
{
hidingRHP
=
!
hidingRHP
hidingRHP
=
!
hidingRHP
self
.
_api
.
setEditorSize
(
hidingRHP
?
0
:
appAPI
.
config
.
get
(
EDITOR_WINDOW_SIZE
))
self
.
_api
.
setEditorSize
(
hidingRHP
?
0
:
appAPI
.
config
.
get
(
EDITOR_WINDOW_SIZE
))
$
(
'.toggleRHP i'
).
toggleClass
(
'fa-angle-double-right'
,
!
hidingRHP
)
$
(
'.toggleRHP i'
).
toggleClass
(
'fa-angle-double-right'
,
!
hidingRHP
)
$
(
'.toggleRHP i'
).
toggleClass
(
'fa-angle-double-left'
,
hidingRHP
)
$
(
'.toggleRHP i'
).
toggleClass
(
'fa-angle-double-left'
,
hidingRHP
)
})
// ----------------- tabbed menu -----------------
var
tabbedMenuAPI
=
{
warnCompilerLoading
:
appAPI
.
warnCompilerLoading
}
// load tabbed menu component
var
tabEvents
=
{
compiler
:
events
.
compiler
,
app
:
events
.
app
}
tabbedMenu
(
options
,
tabbedMenuAPI
,
tabEvents
,
{})
// ----------------- resizeable ui ---------------
var
EDITOR_WINDOW_SIZE
=
'editorWindowSize'
var
dragging
=
false
$
(
'#dragbar'
).
mousedown
(
function
(
e
)
{
e
.
preventDefault
()
dragging
=
true
var
main
=
$
(
'#righthand-panel'
)
var
ghostbar
=
$
(
'<div id="ghostbar">'
,
{
css
:
{
top
:
main
.
offset
().
top
,
left
:
main
.
offset
().
left
}
}).
prependTo
(
'body'
)
$
(
document
).
mousemove
(
function
(
e
)
{
ghostbar
.
css
(
'left'
,
e
.
pageX
+
2
)
})
})
})
var
$body
=
$
(
'body'
)
// ----------------- tabbed menu -----------------
var
tabbedMenuAPI
=
{
warnCompilerLoading
:
appAPI
.
warnCompilerLoading
}
// load tabbed menu component
var
tabEvents
=
{
compiler
:
events
.
compiler
,
app
:
events
.
app
}
tabbedMenu
(
options
,
tabbedMenuAPI
,
tabEvents
,
{})
// ----------------- resizeable ui ---------------
var
EDITOR_WINDOW_SIZE
=
'editorWindowSize'
var
dragging
=
false
$
(
'#dragbar'
).
mousedown
(
function
(
e
)
{
e
.
preventDefault
()
dragging
=
true
var
main
=
$
(
'#righthand-panel'
)
var
ghostbar
=
$
(
'<div id="ghostbar">'
,
{
css
:
{
top
:
main
.
offset
().
top
,
left
:
main
.
offset
().
left
}
}).
prependTo
(
'body'
)
$
(
document
).
mousemove
(
function
(
e
)
{
ghostbar
.
css
(
'left'
,
e
.
pageX
+
2
)
})
})
function
getEditorSize
()
{
var
$body
=
$
(
'body'
)
return
$
(
'#righthand-panel'
).
width
()
}
$
(
document
).
mouseup
(
function
(
e
)
{
function
getEditorSize
()
{
if
(
dragging
)
{
return
$
(
'#righthand-panel'
).
width
()
var
delta
=
$body
.
width
()
-
e
.
pageX
+
2
$
(
'#ghostbar'
).
remove
()
$
(
document
).
unbind
(
'mousemove'
)
dragging
=
false
delta
=
(
delta
<
50
)
?
50
:
delta
self
.
_api
.
setEditorSize
(
delta
)
appAPI
.
config
.
set
(
EDITOR_WINDOW_SIZE
,
delta
)
appAPI
.
reAdjust
()
}
}
})
if
(
appAPI
.
config
.
exists
(
EDITOR_WINDOW_SIZE
))
{
$
(
document
).
mouseup
(
function
(
e
)
{
setTimeout
(
function
()
{
if
(
dragging
)
{
var
delta
=
$body
.
width
()
-
e
.
pageX
+
2
$
(
'#ghostbar'
).
remove
()
$
(
document
).
unbind
(
'mousemove'
)
dragging
=
false
delta
=
(
delta
<
50
)
?
50
:
delta
self
.
_api
.
setEditorSize
(
delta
)
appAPI
.
config
.
set
(
EDITOR_WINDOW_SIZE
,
delta
)
appAPI
.
reAdjust
()
}
})
if
(
appAPI
.
config
.
exists
(
EDITOR_WINDOW_SIZE
))
{
self
.
_api
.
setEditorSize
(
appAPI
.
config
.
get
(
EDITOR_WINDOW_SIZE
))
self
.
_api
.
setEditorSize
(
appAPI
.
config
.
get
(
EDITOR_WINDOW_SIZE
))
}
,
0
)
}
else
{
}
else
{
appAPI
.
config
.
set
(
EDITOR_WINDOW_SIZE
,
getEditorSize
())
appAPI
.
config
.
set
(
EDITOR_WINDOW_SIZE
,
getEditorSize
())
}
}
}
}
}
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