Added auto close option to drawer.
This commit is contained in:
		| @@ -134,6 +134,7 @@ class Drawer extends IgniteElement { | |||||||
|                 this.update(); //If responsive is changed we must update. |                 this.update(); //If responsive is changed we must update. | ||||||
|             }), |             }), | ||||||
|             mobile: false, |             mobile: false, | ||||||
|  |             autoClose: true, | ||||||
|             placement: "left", |             placement: "left", | ||||||
|             width: "20em", |             width: "20em", | ||||||
|             height: null, |             height: null, | ||||||
| @@ -195,8 +196,16 @@ class Drawer extends IgniteElement { | |||||||
|         if (this.responsive) { |         if (this.responsive) { | ||||||
|             if (window.innerWidth <= this.breakpoint && !this.mobile) { |             if (window.innerWidth <= this.breakpoint && !this.mobile) { | ||||||
|                 this.mobile = true; |                 this.mobile = true; | ||||||
|  |                  | ||||||
|  |                 if (this.autoClose) { | ||||||
|  |                     this.show = false; | ||||||
|  |                 } | ||||||
|             } else if (window.innerWidth > this.breakpoint && this.mobile) { |             } else if (window.innerWidth > this.breakpoint && this.mobile) { | ||||||
|                 this.mobile = false; |                 this.mobile = false; | ||||||
|  |  | ||||||
|  |                 if (this.autoClose) { | ||||||
|  |                     this.show = true; | ||||||
|  |                 } | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user