@@ -38,16 +38,13 @@ const Toast = (($) => {
3838 const DefaultType = {
3939 animation : 'boolean' ,
4040 autohide : 'boolean' ,
41- delay : '( number|object) '
41+ delay : 'number'
4242 }
4343
4444 const Default = {
4545 animation : true ,
4646 autohide : true ,
47- delay : {
48- show : 0 ,
49- hide : 500
50- }
47+ delay : 500
5148 }
5249
5350 const Selector = {
@@ -95,19 +92,16 @@ const Toast = (($) => {
9592 }
9693 }
9794
98- this . _timeout = setTimeout ( ( ) => {
99- this . _element . classList . add ( ClassName . SHOW )
100-
101- if ( this . _config . animation ) {
102- const transitionDuration = Util . getTransitionDurationFromElement ( this . _element )
95+ this . _element . classList . add ( ClassName . SHOW )
96+ if ( this . _config . animation ) {
97+ const transitionDuration = Util . getTransitionDurationFromElement ( this . _element )
10398
104- $ ( this . _element )
105- . one ( Util . TRANSITION_END , complete )
106- . emulateTransitionEnd ( transitionDuration )
107- } else {
108- complete ( )
109- }
110- } , this . _config . delay . show )
99+ $ ( this . _element )
100+ . one ( Util . TRANSITION_END , complete )
101+ . emulateTransitionEnd ( transitionDuration )
102+ } else {
103+ complete ( )
104+ }
111105 }
112106
113107 hide ( withoutTimeout ) {
@@ -122,7 +116,7 @@ const Toast = (($) => {
122116 } else {
123117 this . _timeout = setTimeout ( ( ) => {
124118 this . _close ( )
125- } , this . _config . delay . hide )
119+ } , this . _config . delay )
126120 }
127121 }
128122
@@ -150,13 +144,6 @@ const Toast = (($) => {
150144 ...typeof config === 'object' && config ? config : { }
151145 }
152146
153- if ( typeof config . delay === 'number' ) {
154- config . delay = {
155- show : config . delay ,
156- hide : config . delay
157- }
158- }
159-
160147 Util . typeCheckConfig (
161148 NAME ,
162149 config ,
0 commit comments