|
Lines 1059-1064
Link Here
|
| 1059 |
} else { |
1059 |
} else { |
| 1060 |
this._items[ index ] = item; |
1060 |
this._items[ index ] = item; |
| 1061 |
} |
1061 |
} |
|
|
1062 |
this._adjustSelectedIndices( index, true ); |
| 1062 |
this._updateScrollHeight(); |
1063 |
this._updateScrollHeight(); |
| 1063 |
}, |
1064 |
}, |
| 1064 |
|
1065 |
|
|
Lines 1070-1076
Link Here
|
| 1070 |
} |
1071 |
} |
| 1071 |
// Order is crucial here: first deselect item then adjust indices |
1072 |
// Order is crucial here: first deselect item then adjust indices |
| 1072 |
this._deselectItem( itemIndex, false ); |
1073 |
this._deselectItem( itemIndex, false ); |
| 1073 |
this._adjustSelectedIndices( itemIndex ); |
1074 |
this._adjustSelectedIndices( itemIndex, false ); |
| 1074 |
this._updateScrollHeight(); |
1075 |
this._updateScrollHeight(); |
| 1075 |
}, |
1076 |
}, |
| 1076 |
|
1077 |
|
|
Lines 1105-1115
Link Here
|
| 1105 |
} |
1106 |
} |
| 1106 |
}, |
1107 |
}, |
| 1107 |
|
1108 |
|
| 1108 |
_adjustSelectedIndices : function( itemIndex ) { |
1109 |
_adjustSelectedIndices : function( itemIndex, increment ) { |
| 1109 |
for( var i = 0; i < this._selected.length; i++ ) { |
1110 |
for( var i = 0; i < this._selected.length; i++ ) { |
| 1110 |
var index = this._selected[ i ]; |
1111 |
var index = this._selected[ i ]; |
| 1111 |
if( itemIndex < index ) { |
1112 |
if( increment ) { |
| 1112 |
this._selected[ i ] = index - 1; |
1113 |
if( itemIndex <= index ) { |
|
|
1114 |
this._selected[ i ] = index + 1; |
| 1115 |
} |
| 1116 |
} else { |
| 1117 |
if( itemIndex < index ) { |
| 1118 |
this._selected[ i ] = index - 1; |
| 1119 |
} |
| 1113 |
} |
1120 |
} |
| 1114 |
} |
1121 |
} |
| 1115 |
}, |
1122 |
}, |