nl_tokens: Toggle the SideNav view and attach / detach listeners
pl_tokens: function updateIsOpen ( isOpen ) { // Support deprecated md-sidenav-focus attribute as fallback var focusEl = $mdUtil . findFocusTarget ( element ) || $mdUtil . findFocusTarget ( element , '[md-sidenav-focus]' ) || element ; var parent = <mask> . parent ( ) ; // If the user hasn't set the disable close events property we are adding // click and escape events to close the sidenav if ( ! disableCloseEvents ) { parent [ isOpen ? 'on' : 'off' ] ( 'keydown' , onKeyDown ) ; if ( backdrop ) backdrop [ isOpen ? 'on' : 'off' ] ( 'click' , close ) ; } var restorePositioning = updateContainerPositions ( parent , isOpen ) ; if ( isOpen ) { // Capture upon opening.. triggeringElement = $document [ 0 ] . activeElement ; triggeringInteractionType = $mdInteraction . getLastInteractionType ( ) ; } disableParentScroll ( isOpen ) ; return promise = $q . all ( [ isOpen && backdrop ? $animate . enter ( backdrop , parent ) : backdrop ? $animate . leave ( backdrop ) : $q . when ( true ) , $animate [ isOpen ? 'removeClass' : 'addClass' ] ( element , 'md-closed' ) ] ) . then ( function ( ) { // Perform focus when animations are ALL done... if ( scope . isOpen ) { $$rAF ( function ( ) { // Notifies child components that the sidenav was opened. Should wait // a frame in order to allow for the element height to be computed. ngWindow . triggerHandler ( 'resize' ) ; } ) ; focusEl && focusEl . focus ( ) ; } // Restores the positioning on the sidenav and backdrop. restorePositioning && restorePositioning ( ) ; } ) ; }