|
1 | | -/*! JSON Editor v0.7.1 - JSON Schema -> HTML Editor |
| 1 | +/*! JSON Editor v0.7.2 - JSON Schema -> HTML Editor |
2 | 2 | * By Jeremy Dorn - https://github.com/jdorn/json-editor/ |
3 | 3 | * Released under the MIT license |
4 | 4 | * |
5 | | - * Date: 2014-07-24 |
| 5 | + * Date: 2014-07-28 |
6 | 6 | */ |
7 | 7 |
|
8 | 8 | /** |
@@ -1546,6 +1546,8 @@ JSONEditor.AbstractEditor = Class.extend({ |
1546 | 1546 | vars = $extend(this.getWatchedFieldValues(),{ |
1547 | 1547 | key: this.key, |
1548 | 1548 | i: this.key, |
| 1549 | + i0: (this.key*1), |
| 1550 | + i1: (this.key*1+1), |
1549 | 1551 | title: this.getTitle() |
1550 | 1552 | }); |
1551 | 1553 | var header_text = this.header_template(vars); |
@@ -2284,7 +2286,7 @@ JSONEditor.defaults.editors.string = JSONEditor.AbstractEditor.extend({ |
2284 | 2286 |
|
2285 | 2287 | JSONEditor.defaults.editors.number = JSONEditor.defaults.editors.string.extend({ |
2286 | 2288 | sanitize: function(value) { |
2287 | | - return (value+"").replace(/[^0-9\.\-]/g,''); |
| 2289 | + return (value+"").replace(/[^0-9\.\-eE]/g,''); |
2288 | 2290 | }, |
2289 | 2291 | getNumColumns: function() { |
2290 | 2292 | return 2; |
@@ -3307,7 +3309,7 @@ JSONEditor.defaults.editors.array = JSONEditor.AbstractEditor.extend({ |
3307 | 3309 | var item_info = this.getItemInfo(i); |
3308 | 3310 | var schema = this.getItemSchema(i); |
3309 | 3311 | schema = this.jsoneditor.expandRefs(schema); |
3310 | | - schema.title = item_info.title+' '+i; |
| 3312 | + schema.title = item_info.title+' '+(i+1); |
3311 | 3313 |
|
3312 | 3314 | var editor = this.jsoneditor.getEditorClass(schema); |
3313 | 3315 |
|
@@ -3601,7 +3603,8 @@ JSONEditor.defaults.editors.array = JSONEditor.AbstractEditor.extend({ |
3601 | 3603 | // If the one we're deleting is the active tab |
3602 | 3604 | if(self.rows[j].tab === self.active_tab) { |
3603 | 3605 | // Make the next tab active if there is one |
3604 | | - if(self.rows[j+1]) new_active_tab = self.rows[j+1].tab; |
| 3606 | + // Note: the next tab is going to be the current tab after deletion |
| 3607 | + if(self.rows[j+1]) new_active_tab = self.rows[j].tab; |
3605 | 3608 | // Otherwise, make the previous tab active if there is one |
3606 | 3609 | else if(j) new_active_tab = self.rows[j-1].tab; |
3607 | 3610 | } |
|
0 commit comments