Replace Array.indexOf() with jQuery.inArray() for older browsers (IE<9)
| | |
| | | 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); |
| | |
| | | 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; })); |
| | | } |