generated from phucbm/gulp-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use EventsManager & add configs.js (#45)
* Use events manger (#44) * feat: use events manger * fix: remove redundant code * fix: add bracket for data-ea in DEFAULTS variable * fix: format code * fix: return default back * fix: add comma * fix: add comma * fix: remove configs file and add on method * fix: add comma * fix: add comma * fix: add bracket for target * docs: update README.md * Add config file (#43) * feat: add config file * fix: format code * fix: add defaults to configs.js * fix: add comma * fix: add comma * fix: replace fire event and add eventsManager * fix: add on method --------- Co-authored-by: Pau15122 <[email protected]>
- Loading branch information
1 parent
b108b3c
commit 07feeee
Showing
6 changed files
with
109 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import {uniqueId} from './utils' | ||
|
||
/** | ||
* Classes | ||
* */ | ||
export const CLASSES = { | ||
enabled: 'easy-tab-accordion-enabled', | ||
active: 'active', | ||
hasAssignedTriggerEvent: 'assigned-trigger-event', | ||
}; | ||
/** | ||
* Attributes | ||
* */ | ||
export const ATTRS = { | ||
container: 'data-eta', | ||
trigger: 'data-eta-trigger', | ||
receiver: 'data-eta-receiver', | ||
hash: 'data-eta-hash', | ||
hashScroll: 'data-eta-hash-scroll', | ||
animation: 'data-eta-animation', | ||
}; | ||
/** | ||
* Defaults | ||
* */ | ||
export const DEFAULTS = { | ||
// selectors | ||
el: document.querySelector('[data-eta]'), // DOM element | ||
id: uniqueId('eta-'), | ||
trigger: '[data-eta-trigger]', // string selector | ||
triggerAttr: 'data-eta-trigger', // attribute name | ||
receiver: '[data-eta-receiver]', // string selector | ||
receiverAttr: 'data-eta-receiver', // attribute name | ||
activeClass: 'active', | ||
|
||
// animation | ||
animation: 'slide', // slide, fade | ||
duration: 450, | ||
scrollIntoView: false, // scroll panel into view when open | ||
|
||
// hash | ||
hash: false, // update hash URL | ||
hashScroll: false, // scroll into view when page loaded with a valid hash | ||
|
||
// responsive | ||
liveBreakpoint: [], // [1920, 1024] => destroy if window.width if bigger than 1920 or less than 1024 | ||
|
||
// avoid double click | ||
avoidDoubleClick: true, | ||
|
||
// dev mode => enable console.log | ||
dev: false, | ||
|
||
// open/close | ||
activeSection: 0, // default opening sections, will be ignored if there's a valid hash, allow array of index [0,1,2] for slide animation only | ||
allowCollapseAll: false, // for slide animation only | ||
allowExpandAll: false, // for slide animation only | ||
|
||
// prevent default when click to trigger element | ||
isPreventDefault: true, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters