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
78f6c4e5
Commit
78f6c4e5
authored
May 21, 2019
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix toaster
parent
19f5b46e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
fileManager.js
src/app/files/fileManager.js
+6
-5
tooltip.js
src/app/ui/tooltip.js
+2
-2
No files found.
src/app/files/fileManager.js
View file @
78f6c4e5
...
@@ -135,9 +135,9 @@ class FileManager extends FileSystemApi {
...
@@ -135,9 +135,9 @@ class FileManager extends FileSystemApi {
if
(
this
.
currentRequest
)
{
if
(
this
.
currentRequest
)
{
let
reject
=
false
let
reject
=
false
let
savedAsAnotherFile
=
false
let
savedAsAnotherFile
=
false
let
warnToaster
let
actions
=
(
toaster
)
=>
{
const
actions
=
yo
`<div class="container ml-1">
return
yo
`<div class="container ml-1">
<button class="btn btn-primary btn-sm m-1" onclick=
${(
e
)
=>
{
reject
=
true
;
e
.
target
.
innerHTML
=
'Canceled'
;
warnT
oaster
.
hide
()
}}
>
Cancel
<
/button
>
<button class="btn btn-primary btn-sm m-1" onclick=
${(
e
)
=>
{
reject
=
true
;
e
.
target
.
innerHTML
=
'Canceled'
;
t
oaster
.
hide
()
}}
>
Cancel
<
/button
>
<
button
class
=
"btn btn-primary btn-sm m-1"
onclick
=
$
{(
e
)
=>
{
<
button
class
=
"btn btn-primary btn-sm m-1"
onclick
=
$
{(
e
)
=>
{
if
(
savedAsAnotherFile
)
return
if
(
savedAsAnotherFile
)
return
savedAsAnotherFile
=
true
savedAsAnotherFile
=
true
...
@@ -145,10 +145,11 @@ class FileManager extends FileSystemApi {
...
@@ -145,10 +145,11 @@ class FileManager extends FileSystemApi {
this
.
_setFileInternal
(
newPath
,
content
)
this
.
_setFileInternal
(
newPath
,
content
)
this
.
switchFile
(
newPath
)
this
.
switchFile
(
newPath
)
e
.
target
.
innerHTML
=
'Saved'
e
.
target
.
innerHTML
=
'Saved'
warnT
oaster
.
hide
()
t
oaster
.
hide
()
}}
>
Save
As
Copy
<
/button
>
}}
>
Save
As
Copy
<
/button
>
<
/div>
`
<
/div>
`
warnToaster
=
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-info mr-1"
><
/i><span class="text-primary">${this.currentRequest.from}</
span
>
is
modyfing
<
span
class
=
"text-primary"
>
$
{
path
}
<
/span></
div
>
`, actions, { time: 4000 })
if (reject) throw new Error(`
set
file
operation
on
$
{
path
}
aborted
by
user
.
`)
if (reject) throw new Error(`
set
file
operation
on
$
{
path
}
aborted
by
user
.
`)
if (savedAsAnotherFile) return
if (savedAsAnotherFile) return
}
}
...
...
src/app/ui/tooltip.js
View file @
78f6c4e5
...
@@ -5,11 +5,11 @@ var modal = require('./modal-dialog-custom')
...
@@ -5,11 +5,11 @@ var modal = require('./modal-dialog-custom')
/**
/**
* Open a tooltip
* Open a tooltip
* @param {string} tooltipText The text shown by the tooltip
* @param {string} tooltipText The text shown by the tooltip
* @param {
HTMLElement} [action]
An HTMLElement to display for action
* @param {
function} [action] Returns
An HTMLElement to display for action
*/
*/
module
.
exports
=
function
addTooltip
(
tooltipText
,
action
,
opts
)
{
module
.
exports
=
function
addTooltip
(
tooltipText
,
action
,
opts
)
{
let
t
=
new
Toaster
()
let
t
=
new
Toaster
()
return
t
.
render
(
tooltipText
,
action
,
opts
)
return
t
.
render
(
tooltipText
,
action
(
t
)
,
opts
)
}
}
class
Toaster
{
class
Toaster
{
...
...
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