Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gabriel Monnerat
slapos.toolbox
Commits
7e0537d1
Commit
7e0537d1
authored
Mar 19, 2014
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Warn before closing tab with 'changed' status
parent
98018af6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
slapos/runner/static/js/scripts/softwareFolder.js
slapos/runner/static/js/scripts/softwareFolder.js
+13
-2
No files found.
slapos/runner/static/js/scripts/softwareFolder.js
View file @
7e0537d1
...
@@ -215,10 +215,11 @@ $(document).ready(function () {
...
@@ -215,10 +215,11 @@ $(document).ready(function () {
/* Change selected tab*/
/* Change selected tab*/
$
(
"
#tabControl div.item:last
"
).
click
(
function
()
{
$
(
"
#tabControl div.item:last
"
).
click
(
function
()
{
var
rel
=
$
(
this
).
attr
(
'
rel
'
),
current
;
if
(
$
(
this
).
hasClass
(
'
active
'
)
)
{
if
(
$
(
this
).
hasClass
(
'
active
'
)
)
{
editorlist
[
rel
].
editor
.
focus
();
return
false
;
return
false
;
}
}
var
rel
=
$
(
this
).
attr
(
'
rel
'
),
current
=
$
(
"
#tabContent pre.active
"
).
attr
(
'
rel
'
);
current
=
$
(
"
#tabContent pre.active
"
).
attr
(
'
rel
'
);
if
(
current
&&
current
!==
undefined
)
{
if
(
current
&&
current
!==
undefined
)
{
editorlist
[
current
].
isOpened
=
false
;
editorlist
[
current
].
isOpened
=
false
;
...
@@ -229,6 +230,7 @@ $(document).ready(function () {
...
@@ -229,6 +230,7 @@ $(document).ready(function () {
$
(
"
#tabContent pre[rel='
"
+
rel
+
"
']
"
).
addClass
(
'
active
'
);
$
(
"
#tabContent pre[rel='
"
+
rel
+
"
']
"
).
addClass
(
'
active
'
);
editorlist
[
rel
].
isOpened
=
true
;
editorlist
[
rel
].
isOpened
=
true
;
editorlist
[
rel
].
editor
.
resize
();
editorlist
[
rel
].
editor
.
resize
();
editorlist
[
rel
].
editor
.
focus
();
return
false
;
return
false
;
});
});
...
@@ -236,6 +238,14 @@ $(document).ready(function () {
...
@@ -236,6 +238,14 @@ $(document).ready(function () {
$
(
"
#tabControl div.item:last span.bt_close
"
).
click
(
function
()
{
$
(
"
#tabControl div.item:last span.bt_close
"
).
click
(
function
()
{
var
$tab
=
$
(
this
).
parent
(),
position
=
0
;
var
$tab
=
$
(
this
).
parent
(),
position
=
0
;
var
rel
=
$tab
.
attr
(
'
rel
'
);
var
rel
=
$tab
.
attr
(
'
rel
'
);
if
(
editorlist
[
rel
].
changed
)
{
if
(
!
window
.
confirm
(
"
You have unsaved changes. Your changes will be lost if you don't save them
"
)){
return
false
;
}
if
(
--
beforeunload_warning_set
===
0
)
{
window
.
onbeforeunload
=
function
()
{
return
;
};
}
}
//Remove tab
//Remove tab
if
(
$tab
.
hasClass
(
'
active
'
)
&&
$
(
"
#tabControl div.item
"
).
length
>
0
)
{
if
(
$tab
.
hasClass
(
'
active
'
)
&&
$
(
"
#tabControl div.item
"
).
length
>
0
)
{
position
=
(
$tab
.
index
()
==
0
)
?
1
:
$tab
.
index
();
position
=
(
$tab
.
index
()
==
0
)
?
1
:
$tab
.
index
();
...
@@ -965,6 +975,7 @@ $(document).ready(function () {
...
@@ -965,6 +975,7 @@ $(document).ready(function () {
}
}
resizeTabItems
();
resizeTabItems
();
editorlist
[
hash
].
editor
.
resize
();
editorlist
[
hash
].
editor
.
resize
();
editorlist
[
hash
].
editor
.
focus
();
return
false
;
return
false
;
});
});
...
...
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