diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-11-21 18:45:29 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-11-21 18:45:29 +0100 |
commit | 303e21fc638c2d65b21eb0d8c02d9ab6f658d6e0 (patch) | |
tree | 7b0ba41854b1049e0cfbf1e566202ad29beacab6 /program/js | |
parent | 5bd8712f71d5f5c62bb278da32e3f175ed96de36 (diff) |
Replace Array.indexOf() with jQuery.inArray() for older browsers (IE<9)
Diffstat (limited to 'program/js')
-rw-r--r-- | program/js/app.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/program/js/app.js b/program/js/app.js index 1f8efde03..bd52298d2 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -3682,7 +3682,7 @@ function rcube_webmail() formdata.draft_id = this.env.draft_id; } - $('input, select, textarea', this.gui_objects.messageform).each(function(i, elem){ + $('input, select, textarea', this.gui_objects.messageform).each(function(i, elem) { switch (elem.tagName.toLowerCase()) { case 'input': if (elem.type == 'button' || elem.type == 'submit' || (elem.type == 'hidden' && elem.name != '_is_html')) { @@ -3709,7 +3709,7 @@ function rcube_webmail() var index = this.local_storage_get_item('compose.index', []), key = this.env.compose_id; - if (index.indexOf(key) < 0) { + if ($.inArray(key, index) < 0) { index.push(key); } this.local_storage_set_item('compose.' + key, formdata, true); @@ -3723,7 +3723,7 @@ function rcube_webmail() var ed, formdata = this.local_storage_get_item('compose.' + key, true); if (formdata && typeof formdata == 'object') { - $.each(formdata, function(k, value){ + $.each(formdata, function(k, value) { if (k[0] == '_') { var elem = $("*[name='"+k+"']"); if (elem[0] && elem[0].type == 'checkbox') { @@ -3755,9 +3755,9 @@ function rcube_webmail() if (window.localStorage) { var index = this.local_storage_get_item('compose.index', []); - if (index.indexOf(key) >= 0) { + if ($.inArray(key, index) >= 0) { this.local_storage_remove_item('compose.' + key); - this.local_storage_set_item('compose.index', $.grep(index, function(val,i){ return val != key; })); + this.local_storage_set_item('compose.index', $.grep(index, function(val,i) { return val != key; })); } } }; |