Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
9ff505fd
Commit
9ff505fd
authored
Dec 15, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add unregisterGlobalEventHandlers method
And call it when `converse.initialize` gets called again
parent
003af0c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
dist/converse.js
dist/converse.js
+7
-0
src/headless/converse-core.js
src/headless/converse-core.js
+6
-0
No files found.
dist/converse.js
View file @
9ff505fd
...
@@ -62948,6 +62948,12 @@ function finishInitialization() {
...
@@ -62948,6 +62948,12 @@ function finishInitialization() {
}
}
}
}
function unregisterGlobalEventHandlers() {
document.removeEventListener("visibilitychange", _converse.saveWindowState);
_converse.emit('registeredGlobalEventHandlers');
}
function cleanup() {
function cleanup() {
// Looks like _converse.initialized was called again without logging
// Looks like _converse.initialized was called again without logging
// out or disconnecting in the previous session.
// out or disconnecting in the previous session.
...
@@ -62956,6 +62962,7 @@ function cleanup() {
...
@@ -62956,6 +62962,7 @@ function cleanup() {
_converse.chatboxviews.closeAllChatBoxes();
_converse.chatboxviews.closeAllChatBoxes();
unregisterGlobalEventHandlers();
window.localStorage.clear();
window.localStorage.clear();
window.sessionStorage.clear();
window.sessionStorage.clear();
src/headless/converse-core.js
View file @
9ff505fd
...
@@ -433,12 +433,18 @@ function finishInitialization () {
...
@@ -433,12 +433,18 @@ function finishInitialization () {
}
}
function
unregisterGlobalEventHandlers
()
{
document
.
removeEventListener
(
"
visibilitychange
"
,
_converse
.
saveWindowState
);
_converse
.
emit
(
'
registeredGlobalEventHandlers
'
);
}
function
cleanup
()
{
function
cleanup
()
{
// Looks like _converse.initialized was called again without logging
// Looks like _converse.initialized was called again without logging
// out or disconnecting in the previous session.
// out or disconnecting in the previous session.
// This happens in tests. We therefore first clean up.
// This happens in tests. We therefore first clean up.
Backbone
.
history
.
stop
();
Backbone
.
history
.
stop
();
_converse
.
chatboxviews
.
closeAllChatBoxes
();
_converse
.
chatboxviews
.
closeAllChatBoxes
();
unregisterGlobalEventHandlers
();
window
.
localStorage
.
clear
();
window
.
localStorage
.
clear
();
window
.
sessionStorage
.
clear
();
window
.
sessionStorage
.
clear
();
if
(
_converse
.
bookmarks
)
{
if
(
_converse
.
bookmarks
)
{
...
...
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