|
1159 | 1159 | this.ticks.on('touchstart', angular.bind(this, this.onMove, this.ticks)); |
1160 | 1160 |
|
1161 | 1161 | if (this.options.keyboardSupport) { |
1162 | | - this.minH.on('focus', angular.bind(this, this.onPointerFocus, this.minH, 'rzSliderModel')) |
| 1162 | + this.minH.on('focus', angular.bind(this, this.onPointerFocus, this.minH, 'rzSliderModel')); |
1163 | 1163 | if (this.range) { |
1164 | 1164 | this.maxH.on('focus', angular.bind(this, this.onPointerFocus, this.maxH, 'rzSliderHigh')); |
1165 | 1165 | } |
|
1269 | 1269 | this.callOnEnd(); |
1270 | 1270 | }, |
1271 | 1271 |
|
1272 | | - onPointerFocus: function(pointer, ref, event) { |
| 1272 | + onPointerFocus: function(pointer, ref) { |
1273 | 1273 | this.tracking = ref; |
1274 | 1274 | pointer.one('blur', angular.bind(this, this.onPointerBlur, pointer)); |
1275 | 1275 | pointer.on('keydown', angular.bind(this, this.onKeyboardEvent)); |
1276 | 1276 | pointer.addClass('rz-active'); |
1277 | 1277 | }, |
1278 | 1278 |
|
1279 | | - onPointerBlur: function(pointer, event) { |
| 1279 | + onPointerBlur: function(pointer) { |
1280 | 1280 | pointer.off('keydown'); |
1281 | 1281 | this.tracking = ''; |
1282 | 1282 | pointer.removeClass('rz-active'); |
|
1312 | 1312 |
|
1313 | 1313 | var newValue = this.roundStep(this.sanitizeValue(action)), |
1314 | 1314 | newOffset = this.valueToOffset(newValue); |
1315 | | - var switched = this.positionTrackingHandle(newValue, newOffset); |
1316 | | - if (switched) { |
1317 | | - var pointer = this.tracking === 'rzSliderModel' ? this.minH : this.maxH; |
1318 | | - pointer[0].focus(); //to focus the correct pointer |
1319 | | - } |
| 1315 | + this.positionTrackingHandle(newValue, newOffset); |
1320 | 1316 | }, |
1321 | 1317 |
|
1322 | 1318 | /** |
|
1423 | 1419 | this.tracking = 'rzSliderHigh'; |
1424 | 1420 | this.minH.removeClass('rz-active'); |
1425 | 1421 | this.maxH.addClass('rz-active'); |
| 1422 | + if (this.options.keyboardSupport) |
| 1423 | + this.maxH[0].focus(); |
1426 | 1424 | valueChanged = true; |
1427 | 1425 | } else if (this.tracking === 'rzSliderHigh' && newValue <= this.scope.rzSliderModel) { |
1428 | 1426 | switched = true; |
|
1432 | 1430 | this.tracking = 'rzSliderModel'; |
1433 | 1431 | this.maxH.removeClass('rz-active'); |
1434 | 1432 | this.minH.addClass('rz-active'); |
| 1433 | + if (this.options.keyboardSupport) |
| 1434 | + this.minH[0].focus(); |
1435 | 1435 | valueChanged = true; |
1436 | 1436 | } |
1437 | 1437 | } |
|
0 commit comments