File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ angular.module('g1b.datetime-range', []).
9090 // Close edit popover
9191 scope . close = function ( ) {
9292 scope . selected = '' ;
93+ scope . presetsActive = false ;
9394 scope . calendarActive = false ;
9495
9596 if ( ! ! scope . onClose ) {
@@ -99,7 +100,7 @@ angular.module('g1b.datetime-range', []).
99100
100101 // Bind click events outside directive to close edit popover
101102 $document . on ( 'mousedown' , function ( e ) {
102- if ( ! ! scope . selected && ! element [ 0 ] . contains ( e . target ) ) {
103+ if ( ! element [ 0 ] . contains ( e . target ) && ( ! ! scope . presetsActive || ! ! scope . selected ) ) {
103104 scope . $apply ( function ( ) {
104105 scope . close ( ) ;
105106 } ) ;
@@ -108,7 +109,7 @@ angular.module('g1b.datetime-range', []).
108109
109110 // Bind 'esc' keyup event to close edit popover
110111 $document . on ( 'keyup' , function ( e ) {
111- if ( e . keyCode === 27 && ! ! scope . selected ) {
112+ if ( e . keyCode === 27 && ( ! ! scope . presetsActive || ! ! scope . selected ) ) {
112113 scope . $apply ( function ( ) {
113114 scope . close ( ) ;
114115 } ) ;
You can’t perform that action at this time.
0 commit comments