Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoSot <geo.sotis@gmail.com>2022-02-25 01:11:48 +0300
committerMark Otto <markdotto@gmail.com>2022-02-25 03:41:01 +0300
commit9f7fb2aab5c281dcc6dedfadde70872ce3a8a7bb (patch)
treedcb22bd2733db1289738647ed32f7692622167cc
parentb96cf5aacb7cc9b7b9de2c76e78b688bec4b3f3a (diff)
Help offcanvas follow Css responsiveness
-rw-r--r--js/src/offcanvas.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/js/src/offcanvas.js b/js/src/offcanvas.js
index 2735a9c2ae..71af990902 100644
--- a/js/src/offcanvas.js
+++ b/js/src/offcanvas.js
@@ -185,6 +185,14 @@ class Offcanvas extends BaseComponent {
this.hide()
}
})
+
+ EventHandler.on(window, 'resize', () => {
+ // Add this check to help js be aligned with css changes on responsive offcanvas
+ if (this._isShown && getComputedStyle(this._element).position !== 'fixed') {
+ // this._backdrop.hide()
+ this.hide()
+ }
+ })
}
// Static