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
26b13c80
Commit
26b13c80
authored
May 28, 2019
by
LianaHus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x to close toaster
parent
591e73ac
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
tooltip-styles.js
src/app/ui/styles/tooltip-styles.js
+1
-0
tooltip.js
src/app/ui/tooltip.js
+11
-6
No files found.
src/app/ui/styles/tooltip-styles.js
View file @
26b13c80
...
@@ -15,6 +15,7 @@ var css = csjs`
...
@@ -15,6 +15,7 @@ var css = csjs`
font-size: 14px;
font-size: 14px;
text-align: center;
text-align: center;
bottom: 0;
bottom: 0;
flex-direction: row;
}
}
@-webkit-keyframes animatebottom {
@-webkit-keyframes animatebottom {
0% {bottom: -300px}
0% {bottom: -300px}
...
...
src/app/ui/tooltip.js
View file @
26b13c80
...
@@ -25,8 +25,7 @@ class Toaster {
...
@@ -25,8 +25,7 @@ class Toaster {
render
(
tooltipText
,
action
,
opts
)
{
render
(
tooltipText
,
action
,
opts
)
{
opts
=
defaultOptions
(
opts
)
opts
=
defaultOptions
(
opts
)
let
canShorten
=
true
let
canShorten
=
true
if
(
tooltipText
instanceof
Element
)
if
(
tooltipText
instanceof
Element
)
{
{
canShorten
=
false
canShorten
=
false
}
else
{
}
else
{
if
(
typeof
tooltipText
===
'object'
)
{
if
(
typeof
tooltipText
===
'object'
)
{
...
@@ -45,16 +44,22 @@ class Toaster {
...
@@ -45,16 +44,22 @@ class Toaster {
const
shortTooltipText
=
(
canShorten
&&
tooltipText
.
length
>
201
)
?
tooltipText
.
substring
(
0
,
200
)
+
'...'
:
tooltipText
const
shortTooltipText
=
(
canShorten
&&
tooltipText
.
length
>
201
)
?
tooltipText
.
substring
(
0
,
200
)
+
'...'
:
tooltipText
let
button
=
tooltipText
.
length
>
201
?
yo
`
let
button
=
tooltipText
.
length
>
201
?
yo
`
<button class="btn btn-secondary btn-sm
" onclick=
${()
=>
{
modal
.
alert
(
tooltipText
)
}}
>
show
full
message
<
/button
>
<button class="btn btn-secondary btn-sm
mx-3" style="white-space: nowrap;" onclick=
${()
=>
{
modal
.
alert
(
tooltipText
)
}}
>
See
full
error
<
/button
>
` : ``
` : ``
this.tooltip = yo`
this.tooltip = yo`
<
div
class
=
"${css.tooltip} alert alert-info
"
onmouseenter
=
$
{()
=>
{
over
()
}}
onmouseleave
=
$
{()
=>
{
out
()
}}
>
<
div
class
=
"${css.tooltip} alert alert-info
p-2"
onmouseenter
=
$
{()
=>
{
over
()
}}
onmouseleave
=
$
{()
=>
{
out
()
}}
>
<
span
>
<
span
class
=
"px-2"
>
$
{
shortTooltipText
}
$
{
shortTooltipText
}
${
button
}
${
button
}
${
action
}
</span>
<span style="align-self: baseline;">
<button class="fas fa-times btn-info mx-1 p-0" onclick=
${()
=>
{
this
.
hide
()
resolve
()
}}
><
/button
>
<
/span
>
<
/span
>
${
action
}
<
/div>
`
<
/div>
`
let
timeOut
=
()
=>
{
let
timeOut
=
()
=>
{
return
setTimeout
(()
=>
{
return
setTimeout
(()
=>
{
...
...
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