diff options
| author | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-03-12 23:57:48 +0200 |
|---|---|---|
| committer | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-03-12 23:57:48 +0200 |
| commit | 7aa203150fc1a2ec79c681c13f0d486d531746eb (patch) | |
| tree | f09ba9f69ccd434e9c7fdeb41807fc8008784d8a /html/content/js/Plugins/scrollShadowVert.js | |
| parent | 221af3a2e035bd6689294509feb52f286d3bd5be (diff) | |
| download | classroom-7aa203150fc1a2ec79c681c13f0d486d531746eb.tar.gz classroom-7aa203150fc1a2ec79c681c13f0d486d531746eb.tar.bz2 classroom-7aa203150fc1a2ec79c681c13f0d486d531746eb.zip | |
error pages; js system to support back/front-end
Diffstat (limited to 'html/content/js/Plugins/scrollShadowVert.js')
| -rw-r--r-- | html/content/js/Plugins/scrollShadowVert.js | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/html/content/js/Plugins/scrollShadowVert.js b/html/content/js/Plugins/scrollShadowVert.js deleted file mode 100644 index 2824c22..0000000 --- a/html/content/js/Plugins/scrollShadowVert.js +++ /dev/null @@ -1,57 +0,0 @@ -$$plugins.define('scrollShadowVert', function (element, options) {
- var scrollElm = element.querySelector('.scrollbar'),
- listInner = element.querySelector('.scrollbar__inner');
-
- //observer for adding/removing children elements
- const observer = new MutationObserver(function (mutations) {
- var childrenMutations = mutations.filter((x) => x.type === "childList");
- if (childrenMutations.length > 0) {
- checkScrollPos(scrollElm);
- }
- });
-
- observer.observe(listInner, { subtree: true, childList: true });
-
- //observer for initialized class
- if (options.initialize == true) {
- const targetNode = element;
-
- const observer2 = new MutationObserver(function (mutations) {
- var classMutations = mutations.filter((x) => x.type === "attributes");
- if (classMutations.length > 0 && targetNode.classList.contains('initialized')) {
- checkScrollPos(scrollElm);
- observer2.disconnect();
- }
- });
- observer2.observe(targetNode, { attributes: true, attributeFilter: ['class'] });
- }
-
- checkScrollPos(scrollElm);
-
- scrollElm.addEventListener("scroll", function () {
- checkScrollPos(this);
- });
-
- function checkScrollPos(scrollContainer) {
- if (scrollContainer.scrollTop + element.offsetHeight > listInner.offsetHeight - 8) {
- element.classList.add('scrollbarShadow--bottom');
- } else {
- element.classList.remove('scrollbarShadow--bottom');
- }
- if (scrollContainer.scrollTop < 8) {
- element.classList.add('scrollbarShadow--top');
- } else {
- element.classList.remove('scrollbarShadow--top');
- }
- }
-
- //checkScrollInit();
-
- //function checkScrollInit() {
- // if (element.offsetHeight >= listInner.offsetHeight) {
- // element.classList.add('scrollbarShadow--noScroll');
- // } else {
- // element.classList.remove('scrollbarShadow--noScroll');
- // }
- //}
-});
|
