Skip to content

Commit 840422e

Browse files
committed
Added a listener for the escape button to close datetime range edit popover.
1 parent 81b4860 commit 840422e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/datetime-range.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,16 @@ angular.module('g1b.datetime-range', []).
8989
});
9090
}
9191
});
92+
93+
$document.on('keyup', function (e) {
94+
if ( e.keyCode === 27 && !!scope.selected ) {
95+
scope.$apply(function () {
96+
scope.selected = '';
97+
scope.calendar_active = false;
98+
scope.onClose();
99+
});
100+
}
101+
});
92102
}
93103
};
94104
}

0 commit comments

Comments
 (0)