Skip to content

Commit 200b848

Browse files
committed
chore: sync with CoreUI
2 parents c6905fc + 6510bf6 commit 200b848

29 files changed

+91
-41
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v2.1.16
2+
- fix: Event listeners for Sidebar and AsideMenu plugins persist in jQuery instance - thanks @nesterow closes #77
3+
4+
###### Dependencies update:
5+
- update `core-js` to `^3.3.4`
6+
17
## v2.1.15
28
- fix(sidebar): Selector.NAV_LINK_QUERIED must be "nav-link-queried"
39

README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
[![npm package][npm-badge]][npm]
21
[![NPM downloads][npm-download]][npm]
2+
[![npm package][npm-badge]][npm]
3+
[![npm-coreui-coreui-next][npm-coreui-coreui-next]][npm-coreui-coreui]
34

45
[npm-badge]: https://img.shields.io/npm/v/@coreui/coreui.png?style=flat-square
56
[npm-download]: https://img.shields.io/npm/dm/@coreui/coreui.svg?style=flat-square
67
[npm]: https://www.npmjs.com/package/@coreui/coreui
8+
[npm-coreui-coreui]: https://www.npmjs.com/package/@coreui/coreui
9+
[npm-coreui-coreui-next]: https://img.shields.io/npm/v/@coreui/coreui/next.png?style=flat-square
710

811
# CoreUI - WebApp UI Kit built on top of Bootstrap 4 [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social&logo=twitter)](https://twitter.com/intent/tweet?text=CoreUI%20-%20Free%20Bootstrap%204%20Admin%20Template%20&url=https://coreui.io&hashtags=bootstrap,admin,template,dashboard,panel,free,angular,react,vue)
912

@@ -59,13 +62,13 @@ $ npm install @coreui/coreui --save
5962
### Yarn
6063

6164
``` bash
62-
$ yarn add @coreui/coreui@2.1.15
65+
$ yarn add @coreui/coreui@2.1.16
6366
```
6467

6568
### Composer
6669

6770
``` bash
68-
$ composer require coreui/coreui:2.1.15
71+
$ composer require coreui/coreui:2.1.16
6972
```
7073

7174
## Usage

js/dist/ajax-load.js

+8-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/dist/aside-menu.js

+9-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/dist/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/dist/sidebar.js

+13-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/dist/sidebar.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/dist/toggle-classes.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/dist/utilities/get-color.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/dist/utilities/get-css-custom-properties.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/dist/utilities/get-style.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/dist/utilities/hex-to-rgb.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/dist/utilities/hex-to-rgba.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/dist/utilities/rgb-to-hex.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/src/ajax-load.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import $ from 'jquery'
22

33
/**
44
* --------------------------------------------------------------------------
5-
* CoreUI (v2.1.15): ajax-load.js
5+
* CoreUI (v2.1.16): ajax-load.js
66
* Licensed under MIT (https://coreui.io/license)
77
* --------------------------------------------------------------------------
88
*/
@@ -16,7 +16,7 @@ const AjaxLoad = (($) => {
1616
*/
1717

1818
const NAME = 'ajaxLoad'
19-
const VERSION = '2.1.15'
19+
const VERSION = '2.1.16'
2020
const DATA_KEY = 'coreui.ajaxLoad'
2121
const JQUERY_NO_CONFLICT = $.fn[NAME]
2222

@@ -58,6 +58,7 @@ const AjaxLoad = (($) => {
5858
} else {
5959
this.setUpUrl(this._config.defaultPage)
6060
}
61+
this._removeEventListeners()
6162
this._addEventListeners()
6263
}
6364

@@ -167,6 +168,10 @@ const AjaxLoad = (($) => {
167168
})
168169
}
169170

171+
_removeEventListeners() {
172+
$(document).off(Event.CLICK, `${Selector.NAV_LINK}[href!="#"]`)
173+
}
174+
170175
// Static
171176

172177
static _jQueryInterface(config) {

js/src/aside-menu.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import toggleClasses from './toggle-classes'
33

44
/**
55
* --------------------------------------------------------------------------
6-
* CoreUI (v2.1.15): aside-menu.js
6+
* CoreUI (v2.1.16): aside-menu.js
77
* Licensed under MIT (https://coreui.io/license)
88
* --------------------------------------------------------------------------
99
*/
@@ -16,7 +16,7 @@ const AsideMenu = (($) => {
1616
*/
1717

1818
const NAME = 'aside-menu'
19-
const VERSION = '2.1.15'
19+
const VERSION = '2.1.16'
2020
const DATA_KEY = 'coreui.aside-menu'
2121
const EVENT_KEY = `.${DATA_KEY}`
2222
const DATA_API_KEY = '.data-api'
@@ -51,6 +51,7 @@ const AsideMenu = (($) => {
5151
class AsideMenu {
5252
constructor(element) {
5353
this._element = element
54+
this._removeEventListeners()
5455
this._addEventListeners()
5556
}
5657

@@ -71,6 +72,10 @@ const AsideMenu = (($) => {
7172
})
7273
}
7374

75+
_removeEventListeners() {
76+
$(document).off(Event.CLICK, Selector.ASIDE_MENU_TOGGLER)
77+
}
78+
7479
// Static
7580

7681
static _jQueryInterface() {
@@ -92,7 +97,7 @@ const AsideMenu = (($) => {
9297
* ------------------------------------------------------------------------
9398
*/
9499

95-
$(window).on(Event.LOAD_DATA_API, () => {
100+
$(window).one(Event.LOAD_DATA_API, () => {
96101
const asideMenu = $(Selector.ASIDE_MENU)
97102
AsideMenu._jQueryInterface.call(asideMenu)
98103
})

js/src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Sidebar from './sidebar'
55

66
/**
77
* --------------------------------------------------------------------------
8-
* CoreUI (v2.1.15): index.js
8+
* CoreUI (v2.1.16): index.js
99
* Licensed under MIT (https://coreui.io/license)
1010
* --------------------------------------------------------------------------
1111
*/

js/src/sidebar.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import toggleClasses from './toggle-classes'
55

66
/**
77
* --------------------------------------------------------------------------
8-
* CoreUI (v2.1.15): sidebar.js
8+
* CoreUI (v2.1.16): sidebar.js
99
* Licensed under MIT (https://coreui.io/license)
1010
* --------------------------------------------------------------------------
1111
*/
@@ -18,7 +18,7 @@ const Sidebar = (($) => {
1818
*/
1919

2020
const NAME = 'sidebar'
21-
const VERSION = '2.1.15'
21+
const VERSION = '2.1.16'
2222
const DATA_KEY = 'coreui.sidebar'
2323
const EVENT_KEY = `.${DATA_KEY}`
2424
const DATA_API_KEY = '.data-api'
@@ -87,6 +87,7 @@ const Sidebar = (($) => {
8787
this.setActiveLink()
8888
this._breakpointTest = this._breakpointTest.bind(this)
8989
this._clickOutListener = this._clickOutListener.bind(this)
90+
this._removeEventListeners()
9091
this._addEventListeners()
9192
this._addMediaQuery()
9293
}
@@ -260,6 +261,14 @@ const Sidebar = (($) => {
260261
})
261262
}
262263

264+
_removeEventListeners() {
265+
$(document).off(Event.CLICK, Selector.BRAND_MINIMIZER)
266+
$(document).off(Event.CLICK, Selector.NAV_DROPDOWN_TOGGLE)
267+
$(document).off(Event.CLICK, Selector.SIDEBAR_MINIMIZER)
268+
$(document).off(Event.CLICK, Selector.SIDEBAR_TOGGLER)
269+
$(`${Selector.NAVIGATION} > ${Selector.NAV_ITEM} ${Selector.NAV_LINK}:not(${Selector.NAV_DROPDOWN_TOGGLE})`).off(Event.CLICK)
270+
}
271+
263272
// Static
264273

265274
static _jQueryInterface() {
@@ -281,7 +290,7 @@ const Sidebar = (($) => {
281290
* ------------------------------------------------------------------------
282291
*/
283292

284-
$(window).on(Event.LOAD_DATA_API, () => {
293+
$(window).one(Event.LOAD_DATA_API, () => {
285294
const sidebar = $(Selector.SIDEBAR)
286295
Sidebar._jQueryInterface.call(sidebar)
287296
})

js/src/toggle-classes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* --------------------------------------------------------------------------
3-
* CoreUI (v2.1.15): toggle-classes.js
3+
* CoreUI (v2.1.16): toggle-classes.js
44
* Licensed under MIT (https://coreui.io/license)
55
* --------------------------------------------------------------------------
66
*/

0 commit comments

Comments
 (0)