Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
GLPI
glpi
Commits
4d6ed4bd
Commit
4d6ed4bd
authored
Feb 11, 2020
by
Cédric Anne
Committed by
Johan Cwiklinski
Feb 11, 2020
Browse files
Revert "Warn if there are unsaved form changes (#6433)"
This reverts commit
c19c367a
.
parent
54c4f1bc
Changes
4
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
4d6ed4bd
...
...
@@ -21,7 +21,6 @@ The present file will list all changes made to the project; according to the
-
Add lightbox with PhotoSwipe to timeline images
-
Ability to copy tasks while merging tickets
-
the API gives the ID of the user who logs in with initSession
-
Add warning when there are unsaved changes in forms
-
Kanban view for projects
### Changed
...
...
inc/html.class.php
View file @
4d6ed4bd
...
...
@@ -3924,11 +3924,6 @@ JAVASCRIPT;
editor.on('SaveContent', function (contentEvent) {
contentEvent.content = contentEvent.content.replace(/
\\
r?
\\
n/g, '');
});
editor.on('Change', function (e) {
// Nothing fancy here. Since this is only used for tracking unsaved changes,
// we want to keep the logic in common.js with the other form input events.
onTinyMCEChange(e);
});
// ctrl + enter submit the parent form
editor.addShortcut('ctrl+13', 'submit', function() {
...
...
js/common.js
View file @
4d6ed4bd
...
...
@@ -1019,36 +1019,6 @@ var getTextWithoutDiacriticalMarks = function (text) {
return
text
.
replace
(
/
[\u
0300-
\u
036f
]
/g
,
''
);
};
/** Track input changes and warn the user of unsaved changes if they try to navigate away */
window
.
glpiUnsavedFormChanges
=
false
;
$
(
document
).
ready
(
function
()
{
// Try to limit tracking to item forms by binding to inputs under glpi_tabs only.
var
glpiTabs
=
$
(
'
#page .glpi_tabs
'
);
glpiTabs
.
on
(
'
input
'
,
'
form:not(.no-track) input, form:not(.no-track) textarea
'
,
function
()
{
window
.
glpiUnsavedFormChanges
=
true
;
});
glpiTabs
.
on
(
'
change
'
,
'
form:not(.no-track) select
'
,
function
()
{
window
.
glpiUnsavedFormChanges
=
true
;
});
glpiTabs
.
on
(
'
select2:select
'
,
'
form:not(.no-track) select
'
,
function
()
{
window
.
glpiUnsavedFormChanges
=
true
;
});
$
(
window
).
on
(
'
beforeunload
'
,
function
()
{
if
(
window
.
glpiUnsavedFormChanges
)
{
// Only used for older browsers. Newer ones will display a localized message that is unique to the browser.
return
"
Do you want to leave this site? Changes you made may not be saved.
"
;
}
});
glpiTabs
.
on
(
'
submit
'
,
'
form:not(.no-track)
'
,
function
()
{
window
.
glpiUnsavedFormChanges
=
false
;
});
});
function
onTinyMCEChange
()
{
window
.
glpiUnsavedFormChanges
=
true
;
}
/**
* Updates an accessible progress bar title and foreground width.
* @since 9.5.0
...
...
js/impact.js
View file @
4d6ed4bd
...
...
@@ -2418,7 +2418,6 @@ var GLPIImpact = {
* Enable the save button
*/
showCleanWorkspaceStatus
:
function
()
{
window
.
glpiUnsavedFormChanges
=
false
;
$
(
GLPIImpact
.
selectors
.
save
).
removeClass
(
'
dirty
'
);
$
(
GLPIImpact
.
selectors
.
save
).
removeClass
(
'
clean
'
);
// Needed for animations if the workspace is not dirty
$
(
GLPIImpact
.
selectors
.
save
).
addClass
(
'
clean
'
);
...
...
@@ -2430,7 +2429,6 @@ var GLPIImpact = {
* Enable the save button
*/
showDirtyWorkspaceStatus
:
function
()
{
window
.
glpiUnsavedFormChanges
=
true
;
$
(
GLPIImpact
.
selectors
.
save
).
removeClass
(
'
clean
'
);
$
(
GLPIImpact
.
selectors
.
save
).
addClass
(
'
dirty
'
);
$
(
GLPIImpact
.
selectors
.
save
).
find
(
'
i
'
).
removeClass
(
"
fas fa-check
"
);
...
...
Write
Preview
Supports
Markdown
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