mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-11-24 06:13:31 +00:00
Merge "Execute codeMirror.save() on beforeunload"
This commit is contained in:
commit
99b919f626
|
@ -561,4 +561,11 @@
|
|||
}
|
||||
}
|
||||
|
||||
// Synchronize textarea with CodeMirror before leaving
|
||||
window.addEventListener( 'beforeunload', function () {
|
||||
if ( codeMirror ) {
|
||||
codeMirror.save();
|
||||
}
|
||||
} );
|
||||
|
||||
}( mediaWiki, jQuery ) );
|
||||
|
|
Loading…
Reference in a new issue