Commit 90261b48 authored by Johann-S's avatar Johann-S Committed by XhmikosR
Browse files

Dropdown without jQuery

parent 330a2973
main cleanup-floating-forms cssvar-function dependabot/npm_and_yarn/stylelint-and-stylelint-config-twbs-bootstrap-15.3.0 extend-snippets feat/data-target floating-always-visible floating-labels-icons fod-main-banner form-controls-with-icons github/fork/719media/patch-13 github/fork/719media/patch-14 github/fork/719media/patch-9 github/fork/ChellyAhmed/fix-typo-reboot.md github/fork/ChellyAhmed/offcanvas-scroll-back github/fork/CtrlAltLilith/main github/fork/Elysiome/offcanvas-optional-window-resizing github/fork/JanSargsyan/main github/fork/LunicLynx/support-different-line-height-for-buttons github/fork/Psixodelik/main github/fork/Ronid1/ronid1/offcanvas_static_backdrop github/fork/RyanBerliner/tooltip-accessibility github/fork/SantiagoPVazquez/Feature-default-border-bottom-to-dropdown-item github/fork/Sir-Genius/utils github/fork/Sumit-Singh-8/main github/fork/Viktor-VERA2020/offcanvas-slide github/fork/Zivangu9/input-group-for-form-control-plaintext github/fork/alpadev/alpadev/call-dispose-on-component-reinstantiation github/fork/astagi/fix/tree-shake-modules github/fork/compnerd/dark-accordion-icon github/fork/derSascha/dropdown-dont-close-on-input-click github/fork/dev-ph1l/main github/fork/donquixote/issue-33861-utl-mixin github/fork/florianlacreuse/mixin-make-row-gutter-y github/fork/gregorw/main github/fork/iteggmbh/transitionend-dispose-race github/fork/jdelStrother/patch-1 github/fork/jonnysp/form-floating github/fork/jonnysp/independent-offcanvas github/fork/jonnysp/theme-dark-on-card-and-modal-fix github/fork/josefdlange/floating-label-placeholder-opacity github/fork/julien-deramond/enhance-change-version.js github/fork/julien-deramond/main-jd-fix-offset-content github/fork/julien-deramond/main-jd-issue-with-utitlies github/fork/julien-deramond/main-xmr-pa11y-ci-jd-add-hideElements github/fork/kyletsang/fix-tooltip-padding github/fork/lacutah/CheckboxCenteringDocumentation github/fork/lekoala/patch-3 github/fork/louismaximepiton/main-kld-lmp-collapse-proposal github/fork/louismaximepiton/main-lmp-card-inner-border-radius-fix github/fork/louismaximepiton/main-lmp-carousel-multiple-images github/fork/louismaximepiton/main-lmp-css-var-init github/fork/louismaximepiton/main-lmp-disabled-floating-label-fix github/fork/louismaximepiton/main-lmp-input-range-fix github/fork/louismaximepiton/main-lmp-shift-color github/fork/louismaximepiton/main-lmp-table-active-tr-fix github/fork/maciek-szn/switch github/fork/michael-roth/feature/19964-multiple-tab-targets github/fork/mistic100/dom-utils github/fork/nkdas91/accordion github/fork/nstungcom/fix-missing-modal-open-class github/fork/oraliahdz/animation-utilities github/fork/pine3ree/patch-7 github/fork/pouwerkerk/unindent-scss-docs-shortcode github/fork/smares/smares-no-scolling-on-modal-close github/fork/tgm-git/patch-1 gs-forms gs-toasts-with-animated-progress-bar gs/add-history-helper gs/change-version-dir-on-docs gs/data-must-set-onlu-one-instance gs/docs/fix-drop-down-error gs/event-handler-2 gs/make-docs-js-build gs/make-simple-attribute-toggler gs/popover-fix-doc gs/provide-steConfig-method gs/scrollspy-smoothscroll-option-use-browser-history gs/streamline-jqueryInterface gs/support-drop-down-in-navbar gs/test-js-generic-trigger gs/try-web-components gs/tweak-collapse-js-selector gs/use-event-handler-in-cocmponent gs/use-rollup-replace-for-version jo-docs-thanks-page jo-ssr-friendly logical-props-spacing-utils main-fod-disabled-form-check-label main-fod-nested-accordion main-fod-simpler-table-structure main-fod-table-separator main-fod-utilities-contrast main-jd-abbr-title main-jd-add-chips main-jd-add-doc-for-sass-custom-colors main-jd-add-enable-host-to-handle-web-components main-jd-browserstack-fine-tune main-jd-browserstack-updates main-jd-docs-consistent-usage-of-css-sections-step-2 main-jd-fix-docs-headers-in-white main-jd-fix-highlight-docs-border-radius main-jd-fix-placeholder-color-background-params-for-img-markup main-jd-glossary-experiment main-jd-postcss-drop-empty-css-vars main-jd-proto-doc-astro main-jd-skip-navigation-component main-jd-stackblitz-for-examples main-jd-upgrade-browserlistrc main-jd-use-host main-lmp-dark-theme-customization main-lmp-handle-scroll-target main-lmp-tab-fix main-mc-opensearch main-xmr-bundlewatch-action main-xmr-eslint-plugin-compat main-xmr-hugo-docs-vendor main-xmr-hugo-rm-ver main-xmr-linkinator-prod main-xmr-min-mangle main-xmr-pa11y-ci more-darkmode-examples nested-dropdowns patrickhlauke-issue37428 patrickhlauke-use-of-color-tweaks pr/34102 pr/37590 previous-next-docs-links sticky-thead utilities-functions-mixin v530-dev v6-postcss-custom-media v6-spinner-dots v6/gs/use-floating-ui-in-place-of-popper xmr/dev xmr/docs-png xmr/docs-svgs xmr/hugo-reorg-files xmr/js-2 xmr/markdownlint xmr/prepare-530-alpha2 xmr/xo v5.3.0-alpha1 v5.2.3 v5.2.2 v5.2.1 v5.2.0 v5.2.0-beta1 v5.1.3 v5.1.2 v5.1.1 v5.1.0 v5.0.2 v5.0.1 v5.0.0 v5.0.0-beta3 v5.0.0-beta2 v5.0.0-beta1 v5.0.0-alpha3 v5.0.0-alpha2 v5.0.0-alpha1
5 merge requests!31948Examples/Floating-labels: fix bad behavior with autofill,!30064test,!29779Responsive sizing,!28882fix custom-select-indicator in IE10,!28721Hot test
Showing with 225 additions and 182 deletions
+225 -182
...@@ -334,7 +334,7 @@ const EventHandler = (() => { ...@@ -334,7 +334,7 @@ const EventHandler = (() => {
let defaultPrevented = false let defaultPrevented = false
if (inNamespace && typeof $ !== 'undefined') { if (inNamespace && typeof $ !== 'undefined') {
jQueryEvent = new $.Event(event, args) jQueryEvent = $.Event(event, args)
$(element).trigger(jQueryEvent) $(element).trigger(jQueryEvent)
bubbles = !jQueryEvent.isPropagationStopped() bubbles = !jQueryEvent.isPropagationStopped()
...@@ -342,8 +342,7 @@ const EventHandler = (() => { ...@@ -342,8 +342,7 @@ const EventHandler = (() => {
defaultPrevented = jQueryEvent.isDefaultPrevented() defaultPrevented = jQueryEvent.isDefaultPrevented()
} }
let evt = null let evt = null
if (isNative) { if (isNative) {
evt = document.createEvent('HTMLEvents') evt = document.createEvent('HTMLEvents')
evt.initEvent(typeEvent, bubbles, true) evt.initEvent(typeEvent, bubbles, true)
......
...@@ -38,6 +38,18 @@ const Manipulator = { ...@@ -38,6 +38,18 @@ const Manipulator = {
} }
element.removeAttribute(`data-${key.replace(/[A-Z]/g, (chr) => `-${chr.toLowerCase()}`)}`) element.removeAttribute(`data-${key.replace(/[A-Z]/g, (chr) => `-${chr.toLowerCase()}`)}`)
},
toggleClass(element, className) {
if (typeof element === 'undefined' || element === null) {
return
}
if (element.classList.contains(className)) {
element.classList.remove(className)
} else {
element.classList.add(className)
}
} }
} }
......
...@@ -5,8 +5,11 @@ ...@@ -5,8 +5,11 @@
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
import $ from 'jquery' import Data from './dom/data'
import EventHandler from './dom/eventHandler'
import Manipulator from './dom/manipulator'
import Popper from 'popper.js' import Popper from 'popper.js'
import SelectorEngine from './dom/selectorEngine'
import Util from './util' import Util from './util'
/** /**
...@@ -20,7 +23,6 @@ const VERSION = '4.3.1' ...@@ -20,7 +23,6 @@ const VERSION = '4.3.1'
const DATA_KEY = 'bs.dropdown' const DATA_KEY = 'bs.dropdown'
const EVENT_KEY = `.${DATA_KEY}` const EVENT_KEY = `.${DATA_KEY}`
const DATA_API_KEY = '.data-api' const DATA_API_KEY = '.data-api'
const JQUERY_NO_CONFLICT = $.fn[NAME]
const ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key const ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key
const SPACE_KEYCODE = 32 // KeyboardEvent.which value for space key const SPACE_KEYCODE = 32 // KeyboardEvent.which value for space key
const TAB_KEYCODE = 9 // KeyboardEvent.which value for tab key const TAB_KEYCODE = 9 // KeyboardEvent.which value for tab key
...@@ -120,12 +122,12 @@ class Dropdown { ...@@ -120,12 +122,12 @@ class Dropdown {
// Public // Public
toggle() { toggle() {
if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED)) { if (this._element.disabled || this._element.classList.contains(ClassName.DISABLED)) {
return return
} }
const parent = Dropdown._getParentFromElement(this._element) const parent = Dropdown._getParentFromElement(this._element)
const isActive = $(this._menu).hasClass(ClassName.SHOW) const isActive = this._menu.classList.contains(ClassName.SHOW)
Dropdown._clearMenus() Dropdown._clearMenus()
...@@ -136,11 +138,9 @@ class Dropdown { ...@@ -136,11 +138,9 @@ class Dropdown {
const relatedTarget = { const relatedTarget = {
relatedTarget: this._element relatedTarget: this._element
} }
const showEvent = $.Event(Event.SHOW, relatedTarget) const showEvent = EventHandler.trigger(parent, Event.SHOW, relatedTarget)
$(parent).trigger(showEvent) if (showEvent.defaultPrevented) {
if (showEvent.isDefaultPrevented()) {
return return
} }
...@@ -171,7 +171,7 @@ class Dropdown { ...@@ -171,7 +171,7 @@ class Dropdown {
// to allow the menu to "escape" the scroll parent's boundaries // to allow the menu to "escape" the scroll parent's boundaries
// https://github.com/twbs/bootstrap/issues/24251 // https://github.com/twbs/bootstrap/issues/24251
if (this._config.boundary !== 'scrollParent') { if (this._config.boundary !== 'scrollParent') {
$(parent).addClass(ClassName.POSITION_STATIC) parent.classList.add(ClassName.POSITION_STATIC)
} }
this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig()) this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig())
} }
...@@ -181,68 +181,64 @@ class Dropdown { ...@@ -181,68 +181,64 @@ class Dropdown {
// only needed because of broken event delegation on iOS // only needed because of broken event delegation on iOS
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
if ('ontouchstart' in document.documentElement && if ('ontouchstart' in document.documentElement &&
$(parent).closest(Selector.NAVBAR_NAV).length === 0) { !Util.makeArray(SelectorEngine.closest(parent, Selector.NAVBAR_NAV)).length) {
$(document.body).children().on('mouseover', null, $.noop) Util.makeArray(document.body.children)
.forEach((elem) => EventHandler.on(elem, 'mouseover', null, Util.noop()))
} }
this._element.focus() this._element.focus()
this._element.setAttribute('aria-expanded', true) this._element.setAttribute('aria-expanded', true)
$(this._menu).toggleClass(ClassName.SHOW) Manipulator.toggleClass(this._menu, ClassName.SHOW)
$(parent) Manipulator.toggleClass(parent, ClassName.SHOW)
.toggleClass(ClassName.SHOW) EventHandler.trigger(parent, Event.SHOWN, relatedTarget)
.trigger($.Event(Event.SHOWN, relatedTarget))
} }
show() { show() {
if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED) || $(this._menu).hasClass(ClassName.SHOW)) { if (this._element.disabled || this._element.classList.contains(ClassName.DISABLED) || this._menu.classList.contains(ClassName.SHOW)) {
return return
} }
const parent = Dropdown._getParentFromElement(this._element)
const relatedTarget = { const relatedTarget = {
relatedTarget: this._element relatedTarget: this._element
} }
const showEvent = $.Event(Event.SHOW, relatedTarget)
const parent = Dropdown._getParentFromElement(this._element)
$(parent).trigger(showEvent) const showEvent = EventHandler.trigger(parent, Event.SHOW, relatedTarget)
if (showEvent.isDefaultPrevented()) { if (showEvent.defaultPrevented) {
return return
} }
$(this._menu).toggleClass(ClassName.SHOW) Manipulator.toggleClass(this._menu, ClassName.SHOW)
$(parent) Manipulator.toggleClass(parent, ClassName.SHOW)
.toggleClass(ClassName.SHOW) EventHandler.trigger(parent, Event.SHOWN, relatedTarget)
.trigger($.Event(Event.SHOWN, relatedTarget))
} }
hide() { hide() {
if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED) || !$(this._menu).hasClass(ClassName.SHOW)) { if (this._element.disabled || this._element.classList.contains(ClassName.DISABLED) || !this._menu.classList.contains(ClassName.SHOW)) {
return return
} }
const parent = Dropdown._getParentFromElement(this._element)
const relatedTarget = { const relatedTarget = {
relatedTarget: this._element relatedTarget: this._element
} }
const hideEvent = $.Event(Event.HIDE, relatedTarget)
const parent = Dropdown._getParentFromElement(this._element)
$(parent).trigger(hideEvent) const hideEvent = EventHandler.trigger(parent, Event.HIDE, relatedTarget)
if (hideEvent.isDefaultPrevented()) { if (hideEvent.defaultPrevented) {
return return
} }
$(this._menu).toggleClass(ClassName.SHOW) Manipulator.toggleClass(this._menu, ClassName.SHOW)
$(parent) Manipulator.toggleClass(parent, ClassName.SHOW)
.toggleClass(ClassName.SHOW) EventHandler.trigger(parent, Event.SHOWN, relatedTarget)
.trigger($.Event(Event.HIDDEN, relatedTarget))
} }
dispose() { dispose() {
$.removeData(this._element, DATA_KEY) Data.removeData(this._element, DATA_KEY)
$(this._element).off(EVENT_KEY) EventHandler.off(this._element, EVENT_KEY)
this._element = null this._element = null
this._menu = null this._menu = null
if (this._popper !== null) { if (this._popper !== null) {
...@@ -261,7 +257,7 @@ class Dropdown { ...@@ -261,7 +257,7 @@ class Dropdown {
// Private // Private
_addEventListeners() { _addEventListeners() {
$(this._element).on(Event.CLICK, (event) => { EventHandler.on(this._element, Event.CLICK, (event) => {
event.preventDefault() event.preventDefault()
event.stopPropagation() event.stopPropagation()
this.toggle() this.toggle()
...@@ -271,7 +267,7 @@ class Dropdown { ...@@ -271,7 +267,7 @@ class Dropdown {
_getConfig(config) { _getConfig(config) {
config = { config = {
...this.constructor.Default, ...this.constructor.Default,
...$(this._element).data(), ...Util.getDataAttributes(this._element),
...config ...config
} }
...@@ -296,27 +292,27 @@ class Dropdown { ...@@ -296,27 +292,27 @@ class Dropdown {
} }
_getPlacement() { _getPlacement() {
const $parentDropdown = $(this._element.parentNode) const parentDropdown = this._element.parentNode
let placement = AttachmentMap.BOTTOM let placement = AttachmentMap.BOTTOM
// Handle dropup // Handle dropup
if ($parentDropdown.hasClass(ClassName.DROPUP)) { if (parentDropdown.classList.contains(ClassName.DROPUP)) {
placement = AttachmentMap.TOP placement = AttachmentMap.TOP
if ($(this._menu).hasClass(ClassName.MENURIGHT)) { if (this._menu.classList.contains(ClassName.MENURIGHT)) {
placement = AttachmentMap.TOPEND placement = AttachmentMap.TOPEND
} }
} else if ($parentDropdown.hasClass(ClassName.DROPRIGHT)) { } else if (parentDropdown.classList.contains(ClassName.DROPRIGHT)) {
placement = AttachmentMap.RIGHT placement = AttachmentMap.RIGHT
} else if ($parentDropdown.hasClass(ClassName.DROPLEFT)) { } else if (parentDropdown.classList.contains(ClassName.DROPLEFT)) {
placement = AttachmentMap.LEFT placement = AttachmentMap.LEFT
} else if ($(this._menu).hasClass(ClassName.MENURIGHT)) { } else if (this._menu.classList.contains(ClassName.MENURIGHT)) {
placement = AttachmentMap.BOTTOMEND placement = AttachmentMap.BOTTOMEND
} }
return placement return placement
} }
_detectNavbar() { _detectNavbar() {
return $(this._element).closest('.navbar').length > 0 return Util.makeArray(SelectorEngine.closest(this._element, '.navbar')).length > 0
} }
_getOffset() { _getOffset() {
...@@ -364,22 +360,26 @@ class Dropdown { ...@@ -364,22 +360,26 @@ class Dropdown {
// Static // Static
static _jQueryInterface(config) { static _dropdownInterface(element, config) {
return this.each(function () { let data = Data.getData(element, DATA_KEY)
let data = $(this).data(DATA_KEY) const _config = typeof config === 'object' ? config : null
const _config = typeof config === 'object' ? config : null
if (!data) { if (!data) {
data = new Dropdown(this, _config) data = new Dropdown(element, _config)
$(this).data(DATA_KEY, data) Data.setData(element, DATA_KEY, data)
} }
if (typeof config === 'string') { if (typeof config === 'string') {
if (typeof data[config] === 'undefined') { if (typeof data[config] === 'undefined') {
throw new TypeError(`No method named "${config}"`) throw new Error(`No method named "${config}"`)
}
data[config]()
} }
data[config]()
}
}
static _jQueryInterface(config) {
return this.each(function () {
Dropdown._dropdownInterface(this, config)
}) })
} }
...@@ -389,11 +389,10 @@ class Dropdown { ...@@ -389,11 +389,10 @@ class Dropdown {
return return
} }
const toggles = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE)) const toggles = Util.makeArray(SelectorEngine.find(Selector.DATA_TOGGLE))
for (let i = 0, len = toggles.length; i < len; i++) { for (let i = 0, len = toggles.length; i < len; i++) {
const parent = Dropdown._getParentFromElement(toggles[i]) const parent = Dropdown._getParentFromElement(toggles[i])
const context = $(toggles[i]).data(DATA_KEY) const context = Data.getData(toggles[i], DATA_KEY)
const relatedTarget = { const relatedTarget = {
relatedTarget: toggles[i] relatedTarget: toggles[i]
} }
...@@ -407,34 +406,34 @@ class Dropdown { ...@@ -407,34 +406,34 @@ class Dropdown {
} }
const dropdownMenu = context._menu const dropdownMenu = context._menu
if (!$(parent).hasClass(ClassName.SHOW)) { if (!parent.classList.contains(ClassName.SHOW)) {
continue continue
} }
if (event && (event.type === 'click' && if (event && (event.type === 'click' &&
/input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && /input|textarea/i.test(event.target.tagName) ||
$.contains(parent, event.target)) { event.type === 'keyup' && event.which === TAB_KEYCODE) &&
parent.contains(event.target)) {
continue continue
} }
const hideEvent = $.Event(Event.HIDE, relatedTarget) const hideEvent = EventHandler.trigger(parent, Event.HIDE, relatedTarget)
$(parent).trigger(hideEvent) if (hideEvent.defaultPrevented) {
if (hideEvent.isDefaultPrevented()) {
continue continue
} }
// If this is a touch-enabled device we remove the extra // If this is a touch-enabled device we remove the extra
// empty mouseover listeners we added for iOS support // empty mouseover listeners we added for iOS support
if ('ontouchstart' in document.documentElement) { if ('ontouchstart' in document.documentElement) {
$(document.body).children().off('mouseover', null, $.noop) Util.makeArray(document.body.children)
.forEach((elem) => EventHandler.off(elem, 'mouseover', null, Util.noop()))
} }
toggles[i].setAttribute('aria-expanded', 'false') toggles[i].setAttribute('aria-expanded', 'false')
$(dropdownMenu).removeClass(ClassName.SHOW) dropdownMenu.classList.remove(ClassName.SHOW)
$(parent) parent.classList.remove(ClassName.SHOW)
.removeClass(ClassName.SHOW) EventHandler.trigger(parent, Event.HIDDEN, relatedTarget)
.trigger($.Event(Event.HIDDEN, relatedTarget))
} }
} }
...@@ -468,26 +467,25 @@ class Dropdown { ...@@ -468,26 +467,25 @@ class Dropdown {
event.preventDefault() event.preventDefault()
event.stopPropagation() event.stopPropagation()
if (this.disabled || $(this).hasClass(ClassName.DISABLED)) { if (this.disabled || this.classList.contains(ClassName.DISABLED)) {
return return
} }
const parent = Dropdown._getParentFromElement(this) const parent = Dropdown._getParentFromElement(this)
const isActive = $(parent).hasClass(ClassName.SHOW) const isActive = parent.classList.contains(ClassName.SHOW)
if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) { if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
if (event.which === ESCAPE_KEYCODE) { if (event.which === ESCAPE_KEYCODE) {
const toggle = parent.querySelector(Selector.DATA_TOGGLE) EventHandler.trigger(SelectorEngine.findOne(Selector.DATA_TOGGLE, parent), 'focus')
$(toggle).trigger('focus')
} }
$(this).trigger('click') EventHandler.trigger(this, 'click')
return return
} }
const items = [].slice.call(parent.querySelectorAll(Selector.VISIBLE_ITEMS)) const items = [].slice.call(parent.querySelectorAll(Selector.VISIBLE_ITEMS))
if (items.length === 0) { if (!items.length) {
return return
} }
...@@ -515,31 +513,34 @@ class Dropdown { ...@@ -515,31 +513,34 @@ class Dropdown {
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
$(document) EventHandler.on(document, Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler)
.on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler) EventHandler.on(document, Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler)
.on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler) EventHandler.on(document, Event.CLICK_DATA_API, Dropdown._clearMenus)
.on(`${Event.CLICK_DATA_API} ${Event.KEYUP_DATA_API}`, Dropdown._clearMenus) EventHandler.on(document, Event.KEYUP_DATA_API, Dropdown._clearMenus)
.on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { EventHandler.on(document, Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
event.preventDefault() event.preventDefault()
event.stopPropagation() event.stopPropagation()
Dropdown._jQueryInterface.call($(this), 'toggle') Dropdown._dropdownInterface(this, 'toggle')
}) })
.on(Event.CLICK_DATA_API, Selector.FORM_CHILD, (e) => { EventHandler
e.stopPropagation() .on(document, Event.CLICK_DATA_API, Selector.FORM_CHILD, (e) => e.stopPropagation())
})
/** /**
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
* jQuery * jQuery
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
* add .dropdown to jQuery only if jQuery is present
*/ */
$.fn[NAME] = Dropdown._jQueryInterface const $ = Util.jQuery
$.fn[NAME].Constructor = Dropdown if (typeof $ !== 'undefined') {
$.fn[NAME].noConflict = () => { const JQUERY_NO_CONFLICT = $.fn[NAME]
$.fn[NAME] = JQUERY_NO_CONFLICT $.fn[NAME] = Dropdown._jQueryInterface
return Dropdown._jQueryInterface $.fn[NAME].Constructor = Dropdown
$.fn[NAME].noConflict = () => {
$.fn[NAME] = JQUERY_NO_CONFLICT
return Dropdown._jQueryInterface
}
} }
export default Dropdown export default Dropdown
...@@ -336,6 +336,5 @@ $(function () { ...@@ -336,6 +336,5 @@ $(function () {
assert.ok(i === 5, 'listener removed again') assert.ok(i === 5, 'listener removed again')
document.body.removeChild(element) document.body.removeChild(element)
}) })
}) })
...@@ -28,6 +28,7 @@ $(function () { ...@@ -28,6 +28,7 @@ $(function () {
QUnit.test('should throw explicit error on undefined method', function (assert) { QUnit.test('should throw explicit error on undefined method', function (assert) {
assert.expect(1) assert.expect(1)
var $el = $('<div/>') var $el = $('<div/>')
$el.appendTo('#qunit-fixture')
$el.bootstrapDropdown() $el.bootstrapDropdown()
try { try {
$el.bootstrapDropdown('noMethod') $el.bootstrapDropdown('noMethod')
...@@ -39,6 +40,7 @@ $(function () { ...@@ -39,6 +40,7 @@ $(function () {
QUnit.test('should return jquery collection containing the element', function (assert) { QUnit.test('should return jquery collection containing the element', function (assert) {
assert.expect(2) assert.expect(2)
var $el = $('<div/>') var $el = $('<div/>')
$el.appendTo('#qunit-fixture')
var $dropdown = $el.bootstrapDropdown() var $dropdown = $el.bootstrapDropdown()
assert.ok($dropdown instanceof $, 'returns jquery collection') assert.ok($dropdown instanceof $, 'returns jquery collection')
assert.strictEqual($dropdown[0], $el[0], 'collection contains element') assert.strictEqual($dropdown[0], $el[0], 'collection contains element')
...@@ -129,13 +131,14 @@ $(function () { ...@@ -129,13 +131,14 @@ $(function () {
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')
.find('[data-toggle="dropdown"]') .find('[data-toggle="dropdown"]')
.bootstrapDropdown() .bootstrapDropdown()
$dropdown
.parent('.dropdown') var dropdownParent = $dropdown.parent('.dropdown')[0]
.on('shown.bs.dropdown', function () {
assert.strictEqual($dropdown.attr('aria-expanded'), 'true', 'aria-expanded is set to string "true" on click') EventHandler.on(dropdownParent, 'shown.bs.dropdown', function () {
done() assert.strictEqual($dropdown.attr('aria-expanded'), 'true', 'aria-expanded is set to string "true" on click')
}) done()
$dropdown.trigger('click') })
EventHandler.trigger($dropdown[0], 'click')
}) })
QUnit.test('should set aria-expanded="false" on target when dropdown menu is hidden', function (assert) { QUnit.test('should set aria-expanded="false" on target when dropdown menu is hidden', function (assert) {
...@@ -157,15 +160,15 @@ $(function () { ...@@ -157,15 +160,15 @@ $(function () {
.find('[data-toggle="dropdown"]') .find('[data-toggle="dropdown"]')
.bootstrapDropdown() .bootstrapDropdown()
$dropdown var dropdownParent = $dropdown.parent('.dropdown')[0]
.parent('.dropdown')
.on('hidden.bs.dropdown', function () {
assert.strictEqual($dropdown.attr('aria-expanded'), 'false', 'aria-expanded is set to string "false" on hide')
done()
})
$dropdown.trigger('click') EventHandler.one(dropdownParent, 'hidden.bs.dropdown', function () {
$(document.body).trigger('click') assert.strictEqual($dropdown.attr('aria-expanded'), 'false', 'aria-expanded is set to string "false" on hide')
done()
})
EventHandler.trigger($dropdown[0], 'click')
EventHandler.trigger(document.body, 'click')
}) })
QUnit.test('should not open dropdown if target is disabled via class', function (assert) { QUnit.test('should not open dropdown if target is disabled via class', function (assert) {
...@@ -197,23 +200,26 @@ $(function () { ...@@ -197,23 +200,26 @@ $(function () {
var done = assert.async() var done = assert.async()
var dropdownHTML = '<div class="tabs">' + var dropdownHTML = '<div class="tabs">' +
'<div class="dropdown">' + '<div class="dropdown">' +
'<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' + ' <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' +
'<div class="dropdown-menu">' + ' <div class="dropdown-menu">' +
'<a class="dropdown-item" href="#">Secondary link</a>' + ' <a class="dropdown-item" href="#">Secondary link</a>' +
'<a class="dropdown-item" href="#">Something else here</a>' + ' <a class="dropdown-item" href="#">Something else here</a>' +
'<div class="divider"/>' + ' <div class="divider"/>' +
'<a class="dropdown-item" href="#">Another link</a>' + ' <a class="dropdown-item" href="#">Another link</a>' +
'</div>' + ' </div>' +
'</div>' + ' </div>' +
'</div>' '</div>'
var $dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown()
$(dropdownHTML).appendTo('#qunit-fixture')
var $dropdown = $('#qunit-fixture').find('[data-toggle="dropdown"]').bootstrapDropdown()
$dropdown $dropdown
.parent('.dropdown') .parent('.dropdown')
.on('shown.bs.dropdown', function () { .on('shown.bs.dropdown', function () {
assert.ok($dropdown.parent('.dropdown').hasClass('show'), '"show" class added on click') assert.ok($dropdown.parent('.dropdown').hasClass('show'), '"show" class added on click')
done() done()
}) })
$dropdown.trigger('click') EventHandler.trigger($dropdown[0], 'click')
}) })
QUnit.test('should remove "show" class if body is clicked', function (assert) { QUnit.test('should remove "show" class if body is clicked', function (assert) {
...@@ -244,7 +250,8 @@ $(function () { ...@@ -244,7 +250,8 @@ $(function () {
assert.ok(!$dropdown.parent('.dropdown').hasClass('show'), '"show" class removed') assert.ok(!$dropdown.parent('.dropdown').hasClass('show'), '"show" class removed')
done() done()
}) })
$dropdown.trigger('click')
EventHandler.trigger($dropdown[0], 'click')
}) })
QUnit.test('should remove "show" class if tabbing outside of menu', function (assert) { QUnit.test('should remove "show" class if tabbing outside of menu', function (assert) {
...@@ -269,14 +276,17 @@ $(function () { ...@@ -269,14 +276,17 @@ $(function () {
.parent('.dropdown') .parent('.dropdown')
.on('shown.bs.dropdown', function () { .on('shown.bs.dropdown', function () {
assert.ok($dropdown.parent('.dropdown').hasClass('show'), '"show" class added on click') assert.ok($dropdown.parent('.dropdown').hasClass('show'), '"show" class added on click')
var e = $.Event('keyup')
e.which = 9 // Tab EventHandler.trigger(document.body, 'keyup', {
$(document.body).trigger(e) which: 9 // Tab
}).on('hidden.bs.dropdown', function () { })
})
.on('hidden.bs.dropdown', function () {
assert.ok(!$dropdown.parent('.dropdown').hasClass('show'), '"show" class removed') assert.ok(!$dropdown.parent('.dropdown').hasClass('show'), '"show" class removed')
done() done()
}) })
$dropdown.trigger('click')
EventHandler.trigger($dropdown[0], 'click')
}) })
QUnit.test('should remove "show" class if body is clicked, with multiple dropdowns', function (assert) { QUnit.test('should remove "show" class if body is clicked, with multiple dropdowns', function (assert) {
...@@ -310,7 +320,7 @@ $(function () { ...@@ -310,7 +320,7 @@ $(function () {
$(document.body).trigger('click') $(document.body).trigger('click')
}).on('hidden.bs.dropdown', function () { }).on('hidden.bs.dropdown', function () {
assert.strictEqual($('#qunit-fixture .dropdown-menu.show').length, 0, '"show" class removed') assert.strictEqual($('#qunit-fixture .dropdown-menu.show').length, 0, '"show" class removed')
$last.trigger('click') EventHandler.trigger($last[0], 'click')
}) })
$last.parent('.btn-group') $last.parent('.btn-group')
...@@ -322,7 +332,7 @@ $(function () { ...@@ -322,7 +332,7 @@ $(function () {
assert.strictEqual($('#qunit-fixture .dropdown-menu.show').length, 0, '"show" class removed') assert.strictEqual($('#qunit-fixture .dropdown-menu.show').length, 0, '"show" class removed')
done() done()
}) })
$first.trigger('click') EventHandler.trigger($first[0], 'click')
}) })
QUnit.test('should remove "show" class if body if tabbing outside of menu, with multiple dropdowns', function (assert) { QUnit.test('should remove "show" class if body if tabbing outside of menu, with multiple dropdowns', function (assert) {
...@@ -353,26 +363,26 @@ $(function () { ...@@ -353,26 +363,26 @@ $(function () {
.on('shown.bs.dropdown', function () { .on('shown.bs.dropdown', function () {
assert.strictEqual($first.parents('.show').length, 1, '"show" class added on click') assert.strictEqual($first.parents('.show').length, 1, '"show" class added on click')
assert.strictEqual($('#qunit-fixture .dropdown-menu.show').length, 1, 'only one dropdown is shown') assert.strictEqual($('#qunit-fixture .dropdown-menu.show').length, 1, 'only one dropdown is shown')
var e = $.Event('keyup') EventHandler.trigger(document.body, 'keyup', {
e.which = 9 // Tab which: 9 // Tab
$(document.body).trigger(e) })
}).on('hidden.bs.dropdown', function () { }).on('hidden.bs.dropdown', function () {
assert.strictEqual($('#qunit-fixture .dropdown-menu.show').length, 0, '"show" class removed') assert.strictEqual($('#qunit-fixture .dropdown-menu.show').length, 0, '"show" class removed')
$last.trigger('click') EventHandler.trigger($last[0], 'click')
}) })
$last.parent('.btn-group') $last.parent('.btn-group')
.on('shown.bs.dropdown', function () { .on('shown.bs.dropdown', function () {
assert.strictEqual($last.parent('.show').length, 1, '"show" class added on click') assert.strictEqual($last.parent('.show').length, 1, '"show" class added on click')
assert.strictEqual($('#qunit-fixture .dropdown-menu.show').length, 1, 'only one dropdown is shown') assert.strictEqual($('#qunit-fixture .dropdown-menu.show').length, 1, 'only one dropdown is shown')
var e = $.Event('keyup') EventHandler.trigger(document.body, 'keyup', {
e.which = 9 // Tab which: 9 // Tab
$(document.body).trigger(e) })
}).on('hidden.bs.dropdown', function () { }).on('hidden.bs.dropdown', function () {
assert.strictEqual($('#qunit-fixture .dropdown-menu.show').length, 0, '"show" class removed') assert.strictEqual($('#qunit-fixture .dropdown-menu.show').length, 0, '"show" class removed')
done() done()
}) })
$first.trigger('click') EventHandler.trigger($first[0], 'click')
}) })
QUnit.test('should fire show and hide event', function (assert) { QUnit.test('should fire show and hide event', function (assert) {
...@@ -405,8 +415,8 @@ $(function () { ...@@ -405,8 +415,8 @@ $(function () {
done() done()
}) })
$dropdown.trigger('click') EventHandler.trigger($dropdown[0], 'click')
$(document.body).trigger('click') EventHandler.trigger(document.body, 'click')
}) })
QUnit.test('should fire shown and hidden event', function (assert) { QUnit.test('should fire shown and hidden event', function (assert) {
...@@ -439,8 +449,8 @@ $(function () { ...@@ -439,8 +449,8 @@ $(function () {
done() done()
}) })
$dropdown.trigger('click') EventHandler.trigger($dropdown[0], 'click')
$(document.body).trigger('click') EventHandler.trigger(document.body, 'click')
}) })
QUnit.test('should fire shown and hidden event with a relatedTarget', function (assert) { QUnit.test('should fire shown and hidden event with a relatedTarget', function (assert) {
...@@ -472,7 +482,7 @@ $(function () { ...@@ -472,7 +482,7 @@ $(function () {
$(document.body).trigger('click') $(document.body).trigger('click')
}) })
$dropdown.trigger('click') EventHandler.trigger($dropdown[0], 'click')
}) })
QUnit.test('should fire hide and hidden event with a clickEvent', function (assert) { QUnit.test('should fire hide and hidden event with a clickEvent', function (assert) {
...@@ -586,7 +596,7 @@ $(function () { ...@@ -586,7 +596,7 @@ $(function () {
done() done()
}) })
$dropdown.trigger('click') EventHandler.trigger($dropdown[0], 'click')
}) })
QUnit.test('should skip disabled element when using keyboard navigation', function (assert) { QUnit.test('should skip disabled element when using keyboard navigation', function (assert) {
...@@ -621,7 +631,7 @@ $(function () { ...@@ -621,7 +631,7 @@ $(function () {
assert.ok(!$(document.activeElement).is(':disabled'), ':disabled is not focused') assert.ok(!$(document.activeElement).is(':disabled'), ':disabled is not focused')
done() done()
}) })
$dropdown.trigger('click') EventHandler.trigger($dropdown[0], 'click')
}) })
QUnit.test('should focus next/previous element when using keyboard navigation', function (assert) { QUnit.test('should focus next/previous element when using keyboard navigation', function (assert) {
...@@ -645,23 +655,24 @@ $(function () { ...@@ -645,23 +655,24 @@ $(function () {
.parent('.dropdown') .parent('.dropdown')
.on('shown.bs.dropdown', function () { .on('shown.bs.dropdown', function () {
assert.ok(true, 'shown was fired') assert.ok(true, 'shown was fired')
$dropdown.trigger($.Event('keydown', {
EventHandler.trigger($dropdown[0], 'keydown', {
which: 40 which: 40
})) })
assert.ok($(document.activeElement).is($('#item1')), 'item1 is focused') assert.ok($(document.activeElement).is($('#item1')), 'item1 is focused')
$(document.activeElement).trigger($.Event('keydown', { EventHandler.trigger(document.activeElement, 'keydown', {
which: 40 which: 40
})) })
assert.ok($(document.activeElement).is($('#item2')), 'item2 is focused') assert.ok($(document.activeElement).is($('#item2')), 'item2 is focused')
$(document.activeElement).trigger($.Event('keydown', { EventHandler.trigger(document.activeElement, 'keydown', {
which: 38 which: 38
})) })
assert.ok($(document.activeElement).is($('#item1')), 'item1 is focused') assert.ok($(document.activeElement).is($('#item1')), 'item1 is focused')
done() done()
}) })
$dropdown.trigger('click') EventHandler.trigger($dropdown[0], 'click')
}) })
QUnit.test('should not close the dropdown if the user clicks on a text field', function (assert) { QUnit.test('should not close the dropdown if the user clicks on a text field', function (assert) {
...@@ -688,9 +699,9 @@ $(function () { ...@@ -688,9 +699,9 @@ $(function () {
.parent('.dropdown') .parent('.dropdown')
.on('shown.bs.dropdown', function () { .on('shown.bs.dropdown', function () {
assert.ok($dropdown.parent('.dropdown').hasClass('show'), 'dropdown menu is shown') assert.ok($dropdown.parent('.dropdown').hasClass('show'), 'dropdown menu is shown')
$textfield.trigger($.Event('click')) EventHandler.trigger($textfield[0], 'click')
}) })
$dropdown.trigger('click') EventHandler.trigger($dropdown[0], 'click')
}) })
QUnit.test('should not close the dropdown if the user clicks on a textarea', function (assert) { QUnit.test('should not close the dropdown if the user clicks on a textarea', function (assert) {
...@@ -717,9 +728,9 @@ $(function () { ...@@ -717,9 +728,9 @@ $(function () {
.parent('.dropdown') .parent('.dropdown')
.on('shown.bs.dropdown', function () { .on('shown.bs.dropdown', function () {
assert.ok($dropdown.parent('.dropdown').hasClass('show'), 'dropdown menu is shown') assert.ok($dropdown.parent('.dropdown').hasClass('show'), 'dropdown menu is shown')
$textarea.trigger($.Event('click')) EventHandler.trigger($textarea[0], 'click')
}) })
$dropdown.trigger('click') EventHandler.trigger($dropdown[0], 'click')
}) })
QUnit.test('Dropdown should not use Popper.js in navbar', function (assert) { QUnit.test('Dropdown should not use Popper.js in navbar', function (assert) {
...@@ -748,7 +759,7 @@ $(function () { ...@@ -748,7 +759,7 @@ $(function () {
assert.ok(typeof $dropdownMenu.attr('style') === 'undefined', 'No inline style applied by Popper.js') assert.ok(typeof $dropdownMenu.attr('style') === 'undefined', 'No inline style applied by Popper.js')
done() done()
}) })
$triggerDropdown.trigger($.Event('click')) EventHandler.trigger($triggerDropdown[0], 'click')
}) })
QUnit.test('should ignore keyboard events for <input>s and <textarea>s within dropdown-menu, except for escape key', function (assert) { QUnit.test('should ignore keyboard events for <input>s and <textarea>s within dropdown-menu, except for escape key', function (assert) {
...@@ -810,14 +821,16 @@ $(function () { ...@@ -810,14 +821,16 @@ $(function () {
assert.ok($(document.activeElement)[0] === $textarea[0], 'textarea still focused') assert.ok($(document.activeElement)[0] === $textarea[0], 'textarea still focused')
// Key escape // Key escape
$input.trigger('focus').trigger($.Event('keydown', { $input.trigger('focus')
EventHandler.trigger($input[0], 'keydown', {
which: 27 which: 27
})) })
assert.ok(!$dropdown.parent('.dropdown').hasClass('show'), 'dropdown menu is not shown') assert.ok(!$dropdown.parent('.dropdown').hasClass('show'), 'dropdown menu is not shown')
done() done()
}) })
$dropdown.trigger('click') EventHandler.trigger($dropdown[0], 'click')
}) })
QUnit.test('should ignore space key events for <input>s within dropdown, and accept up, down and escape', function (assert) { QUnit.test('should ignore space key events for <input>s within dropdown, and accept up, down and escape', function (assert) {
...@@ -857,35 +870,40 @@ $(function () { ...@@ -857,35 +870,40 @@ $(function () {
assert.ok($(document.activeElement).is($input), 'input is still focused') assert.ok($(document.activeElement).is($input), 'input is still focused')
// Key escape // Key escape
$input.trigger('focus').trigger($.Event('keydown', { $input.trigger('focus')
EventHandler.trigger($input[0], 'keydown', {
which: 27 which: 27
})) })
assert.ok(!$dropdown.parent('.dropdown').hasClass('show'), 'dropdown menu is not shown') assert.ok(!$dropdown.parent('.dropdown').hasClass('show'), 'dropdown menu is not shown')
$dropdown $dropdown
.parent('.dropdown') .parent('.dropdown')
.one('shown.bs.dropdown', function () { .one('shown.bs.dropdown', function () {
assert.ok(true, 'shown was fired')
// Key down // Key down
$input.trigger('focus').trigger($.Event('keydown', { $input.trigger('focus')
EventHandler.trigger($input[0], 'keydown', {
which: 40 which: 40
})) })
assert.ok(document.activeElement === $('#item1')[0], 'item1 is focused') assert.ok(document.activeElement === $('#item1')[0], 'item1 is focused')
$dropdown $dropdown
.parent('.dropdown') .parent('.dropdown')
.one('shown.bs.dropdown', function () { .one('shown.bs.dropdown', function () {
// Key up // Key up
$input.trigger('focus').trigger($.Event('keydown', { $input.trigger('focus')
EventHandler.trigger($input[0], 'keydown', {
which: 38 which: 38
})) })
assert.ok(document.activeElement === $('#item1')[0], 'item1 is focused') assert.ok(document.activeElement === $('#item1')[0], 'item1 is focused')
done() done()
}).bootstrapDropdown('toggle') }).bootstrapDropdown('toggle')
$input.trigger('click') EventHandler.trigger($input[0], 'click')
}) })
$input.trigger('click') EventHandler.trigger($input[0], 'click')
}) })
$input.trigger('click') EventHandler.trigger($input[0], 'click')
}) })
QUnit.test('should ignore space key events for <textarea>s within dropdown, and accept up, down and escape', function (assert) { QUnit.test('should ignore space key events for <textarea>s within dropdown, and accept up, down and escape', function (assert) {
...@@ -925,35 +943,40 @@ $(function () { ...@@ -925,35 +943,40 @@ $(function () {
assert.ok($(document.activeElement).is($textarea), 'textarea is still focused') assert.ok($(document.activeElement).is($textarea), 'textarea is still focused')
// Key escape // Key escape
$textarea.trigger('focus').trigger($.Event('keydown', { $textarea.trigger('focus')
EventHandler.trigger($textarea[0], 'keydown', {
which: 27 which: 27
})) })
assert.ok(!$dropdown.parent('.dropdown').hasClass('show'), 'dropdown menu is not shown') assert.ok(!$dropdown.parent('.dropdown').hasClass('show'), 'dropdown menu is not shown')
$dropdown $dropdown
.parent('.dropdown') .parent('.dropdown')
.one('shown.bs.dropdown', function () { .one('shown.bs.dropdown', function () {
assert.ok(true, 'shown was fired')
// Key down // Key down
$textarea.trigger('focus').trigger($.Event('keydown', { $textarea.trigger('focus')
EventHandler.trigger($textarea[0], 'keydown', {
which: 40 which: 40
})) })
assert.ok(document.activeElement === $('#item1')[0], 'item1 is focused') assert.ok(document.activeElement === $('#item1')[0], 'item1 is focused')
$dropdown $dropdown
.parent('.dropdown') .parent('.dropdown')
.one('shown.bs.dropdown', function () { .one('shown.bs.dropdown', function () {
// Key up // Key up
$textarea.trigger('focus').trigger($.Event('keydown', { $textarea.trigger('focus')
EventHandler.trigger($textarea[0], 'keydown', {
which: 38 which: 38
})) })
assert.ok(document.activeElement === $('#item1')[0], 'item1 is focused') assert.ok(document.activeElement === $('#item1')[0], 'item1 is focused')
done() done()
}).bootstrapDropdown('toggle') }).bootstrapDropdown('toggle')
$textarea.trigger('click') EventHandler.trigger($textarea[0], 'click')
}) })
$textarea.trigger('click') EventHandler.trigger($textarea[0], 'click')
}) })
$textarea.trigger('click') EventHandler.trigger($textarea[0], 'click')
}) })
QUnit.test('should not use Popper.js if display set to static', function (assert) { QUnit.test('should not use Popper.js if display set to static', function (assert) {
......
...@@ -61,6 +61,12 @@ ...@@ -61,6 +61,12 @@
<div class="row"> <div class="row">
<div class="col-sm-12 mt-4"> <div class="col-sm-12 mt-4">
<div class="dropdown">
<button type="button" class="btn btn-secondary" data-toggle="dropdown" aria-expanded="false">Dropdown</button>
<div class="dropdown-menu">
<input id="textField" type="text">
</div>
</div>
<div class="btn-group dropup"> <div class="btn-group dropup">
<button type="button" class="btn btn-secondary">Dropup split</button> <button type="button" class="btn btn-secondary">Dropup split</button>
<button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> <button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
...@@ -206,6 +212,9 @@ ...@@ -206,6 +212,9 @@
<script src="../../../node_modules/jquery/dist/jquery.slim.min.js"></script> <script src="../../../node_modules/jquery/dist/jquery.slim.min.js"></script>
<script src="../../../node_modules/popper.js/dist/umd/popper.min.js"></script> <script src="../../../node_modules/popper.js/dist/umd/popper.min.js"></script>
<script src="../../dist/dom/eventHandler.js"></script> <script src="../../dist/dom/eventHandler.js"></script>
<script src="../../dist/dom/data.js"></script>
<script src="../../dist/dom/selectorEngine.js"></script>
<script src="../../dist/dom/manipulator.js"></script>
<script src="../../dist/util.js"></script> <script src="../../dist/util.js"></script>
<script src="../../dist/dropdown.js"></script> <script src="../../dist/dropdown.js"></script>
<script src="../../dist/collapse.js"></script> <script src="../../dist/collapse.js"></script>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment