This is an automated email from the ASF dual-hosted git repository. brondsem pushed a commit to branch db/8482 in repository https://gitbox.apache.org/repos/asf/allura.git
commit ba9249ae1bb96279890d1f02ff6c0554983a1e39 Author: Dave Brondsema <[email protected]> AuthorDate: Tue Dec 6 17:21:00 2022 -0500 [#8482] Memorable.forget() must run before any other Memorable.add anywhere --- Allura/allura/public/nf/js/memorable.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Allura/allura/public/nf/js/memorable.js b/Allura/allura/public/nf/js/memorable.js index 6b1af609e..25ba554f2 100644 --- a/Allura/allura/public/nf/js/memorable.js +++ b/Allura/allura/public/nf/js/memorable.js @@ -238,14 +238,12 @@ Memorable.inputFactory = function(obj) { } }; -Memorable.items = []; /** * Convenience method to find any classes decorated with `.memorable` and create a related Input object for it * @param selector - use to override the selector used to find all fields to be remembered */ Memorable.initialize = function(selector){ - Memorable.forget(); var s = selector || '.memorable'; $(s).each(function(){ Memorable.add(this); @@ -280,5 +278,7 @@ Memorable.add = function(obj){ }; -// Initialize +// Initialize. Some items must be immediately, not wait until domready, because other Memorable.add usage could happen before our dom-ready initialize fires +Memorable.items = []; +Memorable.forget(); $(function(){Memorable.initialize();});
