mirror of
https://github.com/zulip/zulip.git
synced 2025-11-18 04:43:58 +00:00
upload: Extract feature_check helper function.
This commit is contained in:
@@ -741,11 +741,7 @@ exports.initialize = function () {
|
|||||||
|
|
||||||
resize.watch_manual_resize("#compose-textarea");
|
resize.watch_manual_resize("#compose-textarea");
|
||||||
|
|
||||||
// Run a feature test and decide whether to display
|
upload.feature_check($("#compose #attach_files"));
|
||||||
// the "Attach files" button
|
|
||||||
if (window.XMLHttpRequest && (new XMLHttpRequest()).upload) {
|
|
||||||
$("#compose #attach_files").removeClass("notdisplayed");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Lazy load the Dropbox script, since it can slow our page load
|
// Lazy load the Dropbox script, since it can slow our page load
|
||||||
// otherwise, and isn't enabled for all users. Also, this Dropbox
|
// otherwise, and isn't enabled for all users. Also, this Dropbox
|
||||||
|
|||||||
@@ -21,6 +21,13 @@ function clear_out_file_list(jq_file_list) {
|
|||||||
// $("#file_input").val("");
|
// $("#file_input").val("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Show the upload button only if the browser supports it.
|
||||||
|
exports.feature_check = function (upload_button) {
|
||||||
|
if (window.XMLHttpRequest && (new XMLHttpRequest()).upload) {
|
||||||
|
upload_button.removeClass("notdisplayed");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
exports.options = function (config) {
|
exports.options = function (config) {
|
||||||
var textarea;
|
var textarea;
|
||||||
var send_button;
|
var send_button;
|
||||||
|
|||||||
Reference in New Issue
Block a user