1- /*! tether-drop 1.2.1 */
1+ /*! tether-drop 1.2.2 */
22
33( function ( root , factory ) {
44 if ( typeof define === 'function' && define . amd ) {
1414
1515'use strict' ;
1616
17- var _createClass = ( function ( ) { function defineProperties ( target , props ) { for ( var i = 0 ; i < props . length ; i ++ ) { var descriptor = props [ i ] ; descriptor . enumerable = descriptor . enumerable || false ; descriptor . configurable = true ; if ( 'value' in descriptor ) descriptor . writable = true ; Object . defineProperty ( target , descriptor . key , descriptor ) ; } } return function ( Constructor , protoProps , staticProps ) { if ( protoProps ) defineProperties ( Constructor . prototype , protoProps ) ; if ( staticProps ) defineProperties ( Constructor , staticProps ) ; return Constructor ; } ; } ) ( ) ;
17+ var _bind = Function . prototype . bind ;
1818
19- var _get = function get ( _x2 , _x3 , _x4 ) { var _again = true ; _function: while ( _again ) { var object = _x2 , property = _x3 , receiver = _x4 ; desc = parent = getter = undefined ; _again = false ; var desc = Object . getOwnPropertyDescriptor ( object , property ) ; if ( desc === undefined ) { var parent = Object . getPrototypeOf ( object ) ; if ( parent === null ) { return undefined ; } else { _x2 = parent ; _x3 = property ; _x4 = receiver ; _again = true ; continue _function ; } } else if ( 'value' in desc ) { return desc . value ; } else { var getter = desc . get ; if ( getter === undefined ) { return undefined ; } return getter . call ( receiver ) ; } } } ;
19+ var _slicedToArray = ( function ( ) { function sliceIterator ( arr , i ) { var _arr = [ ] ; var _n = true ; var _d = false ; var _e = undefined ; try { for ( var _i = arr [ Symbol . iterator ] ( ) , _s ; ! ( _n = ( _s = _i . next ( ) ) . done ) ; _n = true ) { _arr . push ( _s . value ) ; if ( i && _arr . length === i ) break ; } } catch ( err ) { _d = true ; _e = err ; } finally { try { if ( ! _n && _i [ 'return' ] ) _i [ 'return' ] ( ) ; } finally { if ( _d ) throw _e ; } } return _arr ; } return function ( arr , i ) { if ( Array . isArray ( arr ) ) { return arr ; } else if ( Symbol . iterator in Object ( arr ) ) { return sliceIterator ( arr , i ) ; } else { throw new TypeError ( 'Invalid attempt to destructure non-iterable instance' ) ; } } ; } ) ( ) ;
2020
21- var _bind = Function . prototype . bind ;
21+ var _createClass = ( function ( ) { function defineProperties ( target , props ) { for ( var i = 0 ; i < props . length ; i ++ ) { var descriptor = props [ i ] ; descriptor . enumerable = descriptor . enumerable || false ; descriptor . configurable = true ; if ( 'value' in descriptor ) descriptor . writable = true ; Object . defineProperty ( target , descriptor . key , descriptor ) ; } } return function ( Constructor , protoProps , staticProps ) { if ( protoProps ) defineProperties ( Constructor . prototype , protoProps ) ; if ( staticProps ) defineProperties ( Constructor , staticProps ) ; return Constructor ; } ; } ) ( ) ;
2222
23- function _slicedToArray ( arr , i ) { if ( Array . isArray ( arr ) ) { return arr ; } else if ( Symbol . iterator in Object ( arr ) ) { var _arr = [ ] ; var _n = true ; var _d = false ; var _e = undefined ; try { for ( var _i = arr [ Symbol . iterator ] ( ) , _s ; ! ( _n = ( _s = _i . next ( ) ) . done ) ; _n = true ) { _arr . push ( _s . value ) ; if ( i && _arr . length === i ) break ; } } catch ( err ) { _d = true ; _e = err ; } finally { try { if ( ! _n && _i [ 'return' ] ) _i [ 'return' ] ( ) ; } finally { if ( _d ) throw _e ; } } return _arr ; } else { throw new TypeError ( 'Invalid attempt to destructure non-iterable instance' ) ; } }
23+ var _get = function get ( _x2 , _x3 , _x4 ) { var _again = true ; _function: while ( _again ) { var object = _x2 , property = _x3 , receiver = _x4 ; desc = parent = getter = undefined ; _again = false ; if ( object === null ) object = Function . prototype ; var desc = Object . getOwnPropertyDescriptor ( object , property ) ; if ( desc === undefined ) { var parent = Object . getPrototypeOf ( object ) ; if ( parent === null ) { return undefined ; } else { _x2 = parent ; _x3 = property ; _x4 = receiver ; _again = true ; continue _function ; } } else if ( 'value' in desc ) { return desc . value ; } else { var getter = desc . get ; if ( getter === undefined ) { return undefined ; } return getter . call ( receiver ) ; } } } ;
2424
2525function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( 'Cannot call a class as a function' ) ; } }
2626
@@ -147,9 +147,9 @@ function createContext() {
147147 }
148148
149149 if ( anyOpen ) {
150- addClass ( document . body , '' + drop . classPrefix + '-open' ) ;
150+ addClass ( document . body , drop . classPrefix + '-open' ) ;
151151 } else {
152- removeClass ( document . body , '' + drop . classPrefix + '-open' ) ;
152+ removeClass ( document . body , drop . classPrefix + '-open' ) ;
153153 }
154154 } ;
155155
@@ -205,7 +205,7 @@ function createContext() {
205205 }
206206
207207 this . content = document . createElement ( 'div' ) ;
208- addClass ( this . content , '' + drop . classPrefix + '-content' ) ;
208+ addClass ( this . content , drop . classPrefix + '-content' ) ;
209209
210210 if ( typeof this . options . content === 'function' ) {
211211 var generateAndSetContent = function generateAndSetContent ( ) {
@@ -369,7 +369,7 @@ function createContext() {
369369 key : 'isOpened' ,
370370 value : function isOpened ( ) {
371371 if ( this . drop ) {
372- return hasClass ( this . drop , '' + drop . classPrefix + '-open' ) ;
372+ return hasClass ( this . drop , drop . classPrefix + '-open' ) ;
373373 }
374374 }
375375 } , {
@@ -398,12 +398,12 @@ function createContext() {
398398 this . tether . enable ( ) ;
399399 }
400400
401- addClass ( this . drop , '' + drop . classPrefix + '-open' ) ;
402- addClass ( this . drop , '' + drop . classPrefix + '-open-transitionend' ) ;
401+ addClass ( this . drop , drop . classPrefix + '-open' ) ;
402+ addClass ( this . drop , drop . classPrefix + '-open-transitionend' ) ;
403403
404404 setTimeout ( function ( ) {
405405 if ( _this3 . drop ) {
406- addClass ( _this3 . drop , '' + drop . classPrefix + '-after-open' ) ;
406+ addClass ( _this3 . drop , drop . classPrefix + '-after-open' ) ;
407407 }
408408 } ) ;
409409
@@ -417,9 +417,13 @@ function createContext() {
417417 }
418418 } , {
419419 key : '_transitionEndHandler' ,
420- value : function _transitionEndHandler ( ) {
421- if ( ! hasClass ( this . drop , '' + drop . classPrefix + '-open' ) ) {
422- removeClass ( this . drop , '' + drop . classPrefix + '-open-transitionend' ) ;
420+ value : function _transitionEndHandler ( e ) {
421+ if ( e . target !== e . currentTarget ) {
422+ return ;
423+ }
424+
425+ if ( ! hasClass ( this . drop , drop . classPrefix + '-open' ) ) {
426+ removeClass ( this . drop , drop . classPrefix + '-open-transitionend' ) ;
423427 }
424428 this . drop . removeEventListener ( transitionEndEvent , this . transitionEndHandler ) ;
425429 }
@@ -448,8 +452,8 @@ function createContext() {
448452 return ;
449453 }
450454
451- removeClass ( this . drop , '' + drop . classPrefix + '-open' ) ;
452- removeClass ( this . drop , '' + drop . classPrefix + '-after-open' ) ;
455+ removeClass ( this . drop , drop . classPrefix + '-open' ) ;
456+ removeClass ( this . drop , drop . classPrefix + '-after-open' ) ;
453457
454458 this . drop . addEventListener ( transitionEndEvent , this . transitionEndHandler ) ;
455459
0 commit comments