From 59aa497e69db5e566de2ec393269ff52986ccc7f Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Wed, 23 Aug 2017 16:31:00 +0200 Subject: [PATCH] Remove custom keyboard mode in datepicker (#13644) --- .../datepicker/datepicker.html | 4 +-- .../datepicker/datepicker.js | 27 ++----------------- 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/src/ui/public/angular-bootstrap/datepicker/datepicker.html b/src/ui/public/angular-bootstrap/datepicker/datepicker.html index 1ecb3c50b4706..807ef80a936a5 100755 --- a/src/ui/public/angular-bootstrap/datepicker/datepicker.html +++ b/src/ui/public/angular-bootstrap/datepicker/datepicker.html @@ -1,5 +1,5 @@ -
+
-
\ No newline at end of file +
diff --git a/src/ui/public/angular-bootstrap/datepicker/datepicker.js b/src/ui/public/angular-bootstrap/datepicker/datepicker.js index 6a75a99788c1d..aa3a4dd50c0a9 100755 --- a/src/ui/public/angular-bootstrap/datepicker/datepicker.js +++ b/src/ui/public/angular-bootstrap/datepicker/datepicker.js @@ -119,6 +119,7 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootst } else { self.activeDate = date; $scope.datepickerMode = self.modes[ self.modes.indexOf( $scope.datepickerMode ) - 1 ]; + focusElement(); } }; @@ -137,6 +138,7 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootst } $scope.datepickerMode = self.modes[ self.modes.indexOf( $scope.datepickerMode ) + direction ]; + focusElement(); }; // Key event mapper @@ -150,31 +152,6 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootst // Listen for focus requests from popup directive $scope.$on('datepicker.focus', focusElement); - - $scope.keydown = function( evt ) { - var key = $scope.keys[evt.which]; - - if ( !key || evt.shiftKey || evt.altKey ) { - return; - } - - evt.preventDefault(); - evt.stopPropagation(); - - if (key === 'enter' || key === 'space') { - if ( self.isDisabled(self.activeDate)) { - return; // do nothing - } - $scope.select(self.activeDate); - focusElement(); - } else if (evt.ctrlKey && (key === 'up' || key === 'down')) { - $scope.toggleMode(key === 'up' ? 1 : -1); - focusElement(); - } else { - self.handleKeyDown(key, evt); - self.refreshView(); - } - }; }]) .directive( 'datepicker', function () {