Commit Graph

180 Commits

Author SHA1 Message Date
GeoSot d4e87d28cd Carousel: small refactoring, remove unnecessary checks 2022-03-09 17:25:47 +02:00
GeoSot dd93551914 Carousel: refactor using inline function and move variables to the proper place 2022-03-09 17:25:47 +02:00
GeoSot 699402bee5 Carousel: refactor `_slide` method te accept only order as first argument 2022-03-09 17:25:47 +02:00
GeoSot fcc2c80976 Carousel: add a `getItems` helper 2022-03-09 17:25:47 +02:00
GeoSot b7cce49dbc Carousel: use combined selector and drop variable used once 2022-03-09 17:25:47 +02:00
GeoSot a8142497c7 Carousel: reorder variables and refactor method to use it inline 2022-03-09 17:25:47 +02:00
GeoSot e77ae50311 Carousel: cleanup jQueryInterface
Drop chained else ifs and unused variable.

Since we were checking for `typeof config === 'string'` in both places, action was never `_config.slide`.
2022-03-09 17:25:47 +02:00
GeoSot c644f09d88 Carousel: simplify carousel items selection
We already know that carousel's parent is the carousel element, so we can use it explicitly
2022-03-01 16:56:33 +02:00
GeoSot eb8d5b43ce Carousel: move `carouselInterface` inside `jqueryInterface` 2022-03-01 16:56:33 +02:00
GeoSot 13042d25ca Carousel: move logic of `dataApiClickHandler` 2022-03-01 16:56:33 +02:00
GeoSot 631cec4f70 Carousel: refactor dataApiKeyHandler to avoid use of `carouselInterface` 2022-03-01 16:56:33 +02:00
GeoSot 642d756eea Carousel: remove one more call to ActiveIndex 2022-02-19 14:52:36 +02:00
GeoSot d52f6c9de1 Carousel: change argument to `_setActiveIndicatorElement`, from element to index 2022-02-19 14:52:36 +02:00
GeoSot 928bdcadc5 Carousel: make direct triggering of slid event, instead of using a callback 2022-02-19 14:52:36 +02:00
GeoSot d97125475b Carousel: merge slide functionality, regardless of whether it is animated or not 2022-02-19 14:52:36 +02:00
GeoSot a247fe9b27 Carousel: simplify initialization on document load, using `getOrCreateInstance` 2022-02-19 14:52:36 +02:00
GeoSot ccba6a3589 Carousel: remove redundant config merge on `dataApiClickHandler`, as it is done by default in the `constructor` 2022-02-19 14:52:36 +02:00
XhmikosR 558002f3dc Return early in more places 2022-01-29 13:25:30 +02:00
XhmikosR 62d86c07f8 Rename variables 2022-01-29 13:25:30 +02:00
GeoSot 0d4213bde3 Carousel: move repeated code to a method 2021-12-21 17:37:24 +02:00
GeoSot b8ee68cfa0 Carousel: remove always true `visibilityState` check
According to https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilityState `visibilityState` is always a string, so the check was always true
2021-12-21 17:37:24 +02:00
GeoSot ff4bf4a458 Carousel: move carousel default interval to `_getConfig()` and simplify it 2021-12-21 17:37:24 +02:00
GeoSot 6f79721c82 Carousel: return early and drop a loop.
We can achieve the same thing by querying the specific selector directly
2021-12-21 17:37:24 +02:00
GeoSot d60f146507 Carousel: add a helper to get the active element 2021-12-21 17:37:24 +02:00
GeoSot 886b940796
Extract Component config functionality to a separate class (#33872)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-12-10 18:18:18 +02:00
XhmikosR e8f702666f
JS: minor refactoring (#35183)
* add missing comments
* shorten block comments
* reorder constants
* reorder public/private methods
* sort exports alphabetically in util/index.js
* fix a couple of typos
2021-10-13 15:19:28 +03:00
GeoSot 8ec6c94522
Extract Carousel's swipe functionality to a separate Class (#32999) 2021-10-11 17:04:43 +03:00
XhmikosR c44d64ed71 Merge remote-tracking branch 'remotes/origin/v513' 2021-10-09 18:28:28 +03:00
XhmikosR 1a6fdfae6b Bump version to 5.1.3. 2021-10-09 09:43:19 +03:00
XhmikosR 666fe596bf Enable `unicorn/no-array-for-each` rule 2021-10-05 19:52:11 +03:00
XhmikosR 2b4d0d166b Enable `unicorn/no-for-loop` rule 2021-10-05 19:52:11 +03:00
XhmikosR 5ecef8ac01
Release v5.1.2 (#35114) 2021-10-05 18:50:18 +03:00
XhmikosR c5d03d93fc
Rename `e` to `event` (#34979) 2021-09-15 14:27:46 +03:00
XhmikosR 0d81d3cbc1
Release v5.1.1 (#34869)
* Prepare v5.1.1.

* Dist
2021-09-07 18:37:44 +03:00
XhmikosR 418fe8113e
carousel: move common checks to a function (#34621) 2021-08-10 17:50:32 +03:00
XhmikosR f20fece3a8
Prepare v5.1.0. (#34674) 2021-08-04 18:41:51 +03:00
XhmikosR 688bce4fa6
Release v5.0.2 (#34276)
* Bump version to v5.0.2.

* Dist
2021-06-22 21:29:16 +03:00
alpadev 290b9ee2cd
fix(carousel): arrow keys break animation if carousel sliding (#34307) 2021-06-22 13:11:03 +03:00
alpadev d62ba935ef
Fix carousel buttons (#34266)
* test(carousel): add test to check if next/prev button work as intended

* fix(carousel): merge passed config with instance config in carouselInterface
2021-06-16 07:48:23 +03:00
GeoSot c98657b830
Add `getOrCreateInstance` method in base-component (#33276)
Co-authored-by: Rohit Sharma <rohit2sharma95@gmail.com>
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-06-03 18:53:27 +03:00
GeoSot df72a21fa8
Add `getNextActiveElement` helper function to utils, replacing custom implementation through components (#33608) 2021-05-19 01:23:52 +03:00
XhmikosR 58b1be927f
Release v5.0.1 (#33972)
* Bump version to 5.0.1.

* Dist
2021-05-13 19:22:20 +03:00
GeoSot 9fe36edf68
Extract static `DATA_KEY` & `EVENT_KEY` to base-component (#33635)
* Force each plugin that extends base-components to implement a static method `NAME()`
* Remove redundant `NAME` argument from 'Utils.defineJQueryPlugin' & fix test
2021-05-11 10:49:30 +03:00
GeoSot 03842b5f25
Refactor: move disposing properties into the base class (#33740)
Moves more functionality to `base-component`, transferring the responsibility of disposal to parent class.
Each component, dusting disposal, sets its protected properties to `null`. So the same can be done in one place for all children components .
2021-05-11 09:04:42 +03:00
GeoSot 90b1a6907e Merge js-components 'transitionend' listener callbacks into one method 2021-05-10 13:59:55 -07:00
XhmikosR bf09367486
Release v5.0.0 (#33647)
* Bump version to 5.0.0

* Fix npm tag

* Dist
2021-05-05 22:32:12 +03:00
GeoSot 566451230f
Remove element event listeners through base component (#33429)
After some research, I found out that EventHandler saves all the custom events per element using namespace, and is capable of removing handlers using only the element and its namespace (`DATA_KEY`).

So, probably is better to utilize the base-component to do the same job.
2021-04-11 09:54:48 +03:00
GeoSot 0795a778f2
Fix wrong carousel transformation, direction to order (#33499) 2021-04-07 08:29:31 +03:00
XhmikosR 220139a89f
Release v5.0.0-beta3 (#33439) 2021-03-23 18:26:54 +02:00
dependabot[bot] 9667438c1e
Bump eslint-plugin-unicorn from 28.0.2 to 29.0.0 (#33435)
* Bump eslint-plugin-unicorn from 28.0.2 to 29.0.0

Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 28.0.2 to 29.0.0.
- [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases)
- [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v28.0.2...v29.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

* Fix lint failure

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-03-23 15:27:46 +02:00