|
@@ -64,8 +64,7 @@ HTMLSelectElement.prototype.awselect = {
|
|
|
}
|
|
|
setTimeout(function() {
|
|
|
let expand_frame = this.expand_frame;
|
|
|
- let expand_background = this.expand_background;
|
|
|
- expand_background.style.transform = '';
|
|
|
+ this.classList.add('expand');
|
|
|
(document.documentElement.clientWidth < mobile_width || immersive) &&
|
|
|
(this.style.top = parseInt(this.style.top) - expand_frame.clientHeight + 'px');
|
|
|
|
|
@@ -90,8 +89,8 @@ HTMLSelectElement.prototype.awselect = {
|
|
|
HTMLSelectElement.prototype.awselect.html_padding_right = `${ window.innerWidth - document.documentElement.clientWidth }px`;
|
|
|
document.documentElement.style.paddingRight = `calc(${ getComputedStyle(document.documentElement).paddingRight } + ${ window.innerWidth - document.documentElement.clientWidth }px)`;
|
|
|
document.documentElement.classList.add('immersive_awselect');
|
|
|
+ document.body.classList.add('immersive_awselect');
|
|
|
}
|
|
|
- document.body.classList.add('immersive_awselect');
|
|
|
let immersive_background = document.createElement('div');
|
|
|
immersive_background.classList.add('awselect_immersive_background');
|
|
|
this.immersive_background = immersive_background;
|
|
@@ -146,7 +145,7 @@ HTMLSelectElement.prototype.awselect = {
|
|
|
}, 300);
|
|
|
this.classList.remove('animate2');
|
|
|
this.expand_frame.classList.remove('overflow');
|
|
|
- this.classList.remove('animate', 'placeholder_animate2');
|
|
|
+ this.classList.remove('animate', 'placeholder_animate2', 'expand');
|
|
|
HTMLSelectElement.prototype.awselect.animates = HTMLSelectElement.prototype.awselect.animates.filter(function (index) { return index !== this;}.bind(this));
|
|
|
setTimeout(function() {
|
|
|
let immersive_shadow = this.immersive_shadow;
|
|
@@ -161,7 +160,7 @@ HTMLSelectElement.prototype.awselect = {
|
|
|
setTimeout(function(){
|
|
|
immersive_shadow.remove();
|
|
|
this.immersive_shadow = undefined;
|
|
|
- if (document.documentElement.matches('.immersive_awselect')) {
|
|
|
+ if (document.body.matches('.immersive_awselect')) {
|
|
|
document.documentElement.style.paddingRight = `calc(${ getComputedStyle(document.documentElement).paddingRight } - ${ HTMLSelectElement.prototype.awselect.html_padding_right })`;
|
|
|
document.documentElement.classList.remove('immersive_awselect');
|
|
|
document.body.classList.remove('immersive_awselect');
|
|
@@ -263,18 +262,17 @@ HTMLSelectElement.prototype.__defineGetter__('awselect', function () {
|
|
|
return (!!this.awselect_section || !(this instanceof HTMLSelectElement)) ? this.__awselect :
|
|
|
(!HTMLSelectElement.prototype.awselect_document_event &&
|
|
|
(document.addEventListener('click', function (event) {
|
|
|
- let option = event.target.closest('.awselect ul li a');
|
|
|
- let awselect = event.target.closest('.awselect');
|
|
|
- if (!!option) {
|
|
|
- awselect.select.value = awselect.select.children[[...option.closest('li').parentElement.children].indexOf(option.closest('li'))].value;
|
|
|
- awselect.dispatchEvent(new Event("change"));
|
|
|
- } else {
|
|
|
- !!awselect && awselect.dispatchEvent(new CustomEvent(awselect.classList.contains('animate') ? 'aw:deanimate' : 'aw:animate', {}));
|
|
|
- }
|
|
|
-
|
|
|
- }) ||
|
|
|
- (new MutationObserver(function () {HTMLSelectElement.prototype.awselect.animates = [...document.getElementsByClassName("awselect animate")]})).observe(document.body, { childList: true, subtree: true }) ||
|
|
|
- document.addEventListener("mouseup", function (event) {
|
|
|
- !event.target.closest('.awselect') && HTMLSelectElement.prototype.awselect.deanimate_all();
|
|
|
- }) || (HTMLSelectElement.prototype.awselect_document_event = true)), this.__awselect.constructor);
|
|
|
+ let option = event.target.closest('.awselect ul li a');
|
|
|
+ let awselect = event.target.closest('.awselect');
|
|
|
+ if (!!option) {
|
|
|
+ awselect.select.value = awselect.select.children[[...option.closest('li').parentElement.children].indexOf(option.closest('li'))].value;
|
|
|
+ awselect.dispatchEvent(new Event("change"));
|
|
|
+ } else {
|
|
|
+ !!awselect && awselect.dispatchEvent(new CustomEvent(awselect.classList.contains('animate') ? 'aw:deanimate' : 'aw:animate', {}));
|
|
|
+ }
|
|
|
+ }) ||
|
|
|
+ (new MutationObserver(function () {HTMLSelectElement.prototype.awselect.animates = [...document.getElementsByClassName("awselect animate")]})).observe(document.body, { childList: true, subtree: true }) ||
|
|
|
+ document.addEventListener("mouseup", function (event) {
|
|
|
+ !event.target.closest('.awselect') && HTMLSelectElement.prototype.awselect.deanimate_all();
|
|
|
+ }) || (HTMLSelectElement.prototype.awselect_document_event = true)), this.__awselect.constructor);
|
|
|
});
|