Skip to content

Commit cf31727

Browse files
committed
mavlink.js: fix IE; doesn't do ECMA6 default parameters
1 parent e58c5bf commit cf31727

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

files/js/mavlink.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ function fill_sr_parameters(plist) {
113113
/*
114114
fill in all divs of form MAVLINK:MSGNAME:field at refresh_ms() rate
115115
*/
116-
function fill_mavlink_ids(options={}) {
116+
function fill_mavlink_ids(options) {
117+
options = options || {}
117118
function again() {
118119
setTimeout(function() { fill_mavlink_ids(options); }, refresh_ms());
119120
}
@@ -266,7 +267,8 @@ function page_fill_json_html(json) {
266267
/*
267268
send a command function
268269
*/
269-
function command_send(command, options={}) {
270+
function command_send(command, options) {
271+
options = options || {}
270272
var args = Array.prototype.slice.call(arguments);
271273
var xhr = createCORSRequest("POST", drone_url + "/ajax/command.json");
272274
var form = new FormData();
@@ -395,7 +397,8 @@ function ajax_get_callback_binary(url, callback) {
395397
/*
396398
poll a URL, calling a callback
397399
*/
398-
function ajax_poll(url, callback, refresh_ms=1000) {
400+
function ajax_poll(url, callback, refresh_ms) {
401+
refresh_ms = refresh_ms || 1000
399402
function again() {
400403
setTimeout(function() { ajax_poll(url, callback, refresh_ms); }, refresh_ms);
401404
}
@@ -419,7 +422,8 @@ function ajax_poll(url, callback, refresh_ms=1000) {
419422
/*
420423
poll a json file and fill document IDs at the given rate
421424
*/
422-
function ajax_json_poll(url, callback, refresh_ms=1000) {
425+
function ajax_json_poll(url, callback, refresh_ms) {
426+
refresh_ms = refresh_ms || 1000
423427
function do_callback(responseText) {
424428
try {
425429
var json = JSON.parse(responseText);
@@ -436,7 +440,8 @@ function ajax_json_poll(url, callback, refresh_ms=1000) {
436440
/*
437441
poll a json file and fill document IDs at the given rate
438442
*/
439-
function ajax_json_poll_fill(url, refresh_ms=1000) {
443+
function ajax_json_poll_fill(url, refresh_ms) {
444+
refresh_ms = refresh_ms || 1000
440445
function callback(json) {
441446
page_fill_json_html(json);
442447
return true;

0 commit comments

Comments
 (0)