You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move some JS code from fomantic.js to standalone files (#27994)
To improve maintainability, this PR:
1. Rename `web_src/js/modules/aria` to `web_src/js/modules/fomantic`
(the code there are all for aria of fomantic)
2. Move api/transition related code to
`web_src/js/modules/fomantic/api.js` and
`web_src/js/modules/fomantic/transition.js`
No logic is changed.
el.classList.remove('visible');// don't remove the transition class because the Fomantic animation style is `.hidden.transition`.
68
-
el.style.removeProperty('display');
69
-
argObj.onHidden?.call(el);
70
-
}
71
-
argObj.onComplete?.call(el);
72
-
});
73
-
returnthis;
74
-
};
75
-
27
+
initFomanticTransition();
76
28
initFomanticApiPatch();
77
29
78
30
// Use the patches to improve accessibility, these patches are designed to be as independent as possible, make it easy to modify or remove in the future.
79
31
initAriaCheckboxPatch();
80
32
initAriaDropdownPatch();
81
33
initAriaModalPatch();
82
34
}
83
-
84
-
functioninitFomanticApiPatch(){
85
-
//
86
-
// Fomantic API module has some very buggy behaviors:
87
-
//
88
-
// If encodeParameters=true, it calls `urlEncodedValue` to encode the parameter.
89
-
// However, `urlEncodedValue` just tries to "guess" whether the parameter is already encoded, by decoding the parameter and encoding it again.
90
-
//
91
-
// There are 2 problems:
92
-
// 1. It may guess wrong, and skip encoding a parameter which looks like encoded.
93
-
// 2. If the parameter can't be decoded, `decodeURIComponent` will throw an error, and the whole request will fail.
94
-
//
95
-
// This patch only fixes the second error behavior at the moment.
0 commit comments