compose.js: Create initialize() function.

This commit is contained in:
Aditya Bansal
2017-06-27 00:59:08 +05:30
committed by showell
parent 1cb5c9faa8
commit 411883365a
2 changed files with 13 additions and 16 deletions

View File

@@ -91,13 +91,6 @@ function update_fade() {
compose_fade.update_faded_messages(); compose_fade.update_faded_messages();
} }
$(function () {
$('#stream,#subject,#private_message_recipient').bind({
keyup: update_fade,
change: update_fade,
});
});
exports.abort_xhr = function () { exports.abort_xhr = function () {
$("#compose-send-button").removeAttr("disabled"); $("#compose-send-button").removeAttr("disabled");
var xhr = $("#compose").data("filedrop_xhr"); var xhr = $("#compose").data("filedrop_xhr");
@@ -418,13 +411,6 @@ exports.finish = function () {
return true; return true;
}; };
$(function () {
$("#compose form").on("submit", function (e) {
e.preventDefault();
compose.finish();
});
});
exports.update_email = function (user_id, new_email) { exports.update_email = function (user_id, new_email) {
var reply_to = compose_state.recipient(); var reply_to = compose_state.recipient();
@@ -617,7 +603,17 @@ exports.validate = function () {
return validate_stream_message(); return validate_stream_message();
}; };
$(function () { exports.initialize = function () {
$('#stream,#subject,#private_message_recipient').bind({
keyup: update_fade,
change: update_fade,
});
$("#compose form").on("submit", function (e) {
e.preventDefault();
compose.finish();
});
resize.watch_manual_resize("#new_message_content"); resize.watch_manual_resize("#new_message_content");
// Run a feature test and decide whether to display // Run a feature test and decide whether to display
@@ -950,7 +946,7 @@ $(function () {
_.extend({}, exports.send_times_data[event.old_id], value); _.extend({}, exports.send_times_data[event.old_id], value);
} }
}); });
}); };
return exports; return exports;
}()); }());

View File

@@ -261,6 +261,7 @@ $(function () {
pm_list.initialize(); pm_list.initialize();
stream_list.initialize(); stream_list.initialize();
drafts.initialize(); drafts.initialize();
compose.initialize();
}); });