drafts.js: Create initialize() function.

This commit is contained in:
Joshua Pan
2017-06-02 14:12:15 -07:00
committed by Tim Abbott
parent 821ff06629
commit bbc0103183
3 changed files with 23 additions and 4 deletions

View File

@@ -383,14 +383,13 @@ exports.launch = function () {
});
};
$(function () {
exports.initialize = function () {
window.addEventListener("beforeunload", function () {
exports.update_draft();
});
$("#new_message_content").focusout(exports.update_draft);
});
};
return exports;