Index: trunk/extensions/VisualEditor/modules/es/es.js |
— | — | @@ -55,15 +55,7 @@ |
56 | 56 | * @param elem {Mixed} Element to search for |
57 | 57 | * @return {Number} Index of elem in arr, or -1 if not found. Comparisons are done with === |
58 | 58 | */ |
59 | | -es.arrayIndexOf = Array.prototype.indexOf ? function( arr, elem ) { return arr.indexOf( elem ); } : function( arr, elem ) { |
60 | | - var i; |
61 | | - for ( i = 0; i < arr.length; i++ ) { |
62 | | - if ( arr[i] === elem ) { |
63 | | - return i; |
64 | | - } |
65 | | - } |
66 | | - return -1; |
67 | | -}; |
| 59 | +es.arrayIndexOf = $.inArray; |
68 | 60 | |
69 | 61 | /** |
70 | 62 | * Recursively compares string and number property between two objects. |
Index: trunk/extensions/VisualEditor/modules/es/bases/es.DocumentBranchNode.js |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | * @param {es.DocumentModelNode} node Child node to find index of |
43 | 43 | * @returns {Integer} Index of child node or -1 if node was not found |
44 | 44 | */ |
45 | | -es.DocumentModelBranchNode.prototype.indexOf = function( node ) { |
| 45 | +es.DocumentBranchNode.prototype.indexOf = function( node ) { |
46 | 46 | return es.arrayIndexOf( this.children, node ); |
47 | 47 | }; |
48 | 48 | |