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
ed01b037
Commit
ed01b037
authored
May 27, 2019
by
LianaHus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
makes tooltip work with DOM element as an inpput
parent
de4dfadc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
17 deletions
+28
-17
fileManager.js
src/app/files/fileManager.js
+7
-1
tooltip.js
src/app/ui/tooltip.js
+21
-16
No files found.
src/app/files/fileManager.js
View file @
ed01b037
...
...
@@ -149,7 +149,13 @@ class FileManager extends FileSystemApi {
}}
>
Save
As
Copy
<
/button
>
<
/div>
`
}
await toaster(yo`
<
div
><
i
class
=
"fas fa-exclamation-triangle text-info mr-1"
><
/i><span class="text-primary">${this.currentRequest.from}</
span
>
is
modyfing
<
span
class
=
"text-primary"
>
$
{
path
}
<
/span></
div
>
`, actions, { time: 4000 })
await toaster(yo`
<
div
>
<
i
class
=
"fas fa-exclamation-triangle text-danger mr-1"
><
/i
>
<
span
>
$
{
this
.
currentRequest
.
from
}
<
span
class
=
"text-warning"
>
is
modyfing
<
/span>${path
}
<
/span
>
<
/div>`, actions, { time: 4000 }
)
if
(
reject
)
throw
new
Error
(
`set file operation on
${
path
}
aborted by user.`
)
if
(
savedAsAnotherFile
)
return
}
...
...
src/app/ui/tooltip.js
View file @
ed01b037
...
...
@@ -24,33 +24,38 @@ class Toaster {
}
render
(
tooltipText
,
action
,
opts
)
{
opts
=
defaultOptions
(
opts
)
if
(
typeof
tooltipText
===
'object'
)
{
if
(
tooltipText
.
message
)
{
tooltipText
=
tooltipText
.
message
}
else
{
try
{
tooltipText
=
JSON
.
stringify
(
tooltipText
)
}
catch
(
e
)
{
let
canShorten
=
true
if
(
tooltipText
instanceof
Element
)
{
canShorten
=
false
}
else
{
if
(
typeof
tooltipText
===
'object'
)
{
if
(
tooltipText
.
message
)
{
tooltipText
=
tooltipText
.
message
}
else
{
try
{
tooltipText
=
JSON
.
stringify
(
tooltipText
)
}
catch
(
e
)
{
}
}
}
}
return
new
Promise
((
resolve
,
reject
)
=>
{
const
shortTooltipText
=
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
`
<button class="btn btn-secondary btn-sm" onclick=
${()
=>
{
modal
.
alert
(
tooltipText
)
}}
>
show
full
message
<
/button
>
` : ``
this.tooltip = yo`
<
div
class
=
"${css.tooltip} alert alert-info"
onmouseenter
=
$
{()
=>
{
over
()
}}
onmouseleave
=
$
{()
=>
{
out
()
}}
>
<
span
>
$
{
shortTooltipText
}
${
button
}
</span>
${
action
}
</div>`
<
div
class
=
"${css.tooltip} alert alert-info"
onmouseenter
=
$
{()
=>
{
over
()
}}
onmouseleave
=
$
{()
=>
{
out
()
}}
>
<
span
>
$
{
shortTooltipText
}
${
button
}
</span>
${
action
}
</div>`
let
timeOut
=
()
=>
{
return
setTimeout
(()
=>
{
if
(
this
.
id
)
{
...
...
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