Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Monster
Manage
Activity
Members
Plan
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSS
Libraries
Javascript
Monster
Commits
5b164772
Verified
Commit
5b164772
authored
1 year ago
by
Volker Schukai
Browse files
Options
Downloads
Patches
Plain Diff
fix: bind this to callback and fix timing #158 #164
parent
9f6d5f8a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/dom/updater.mjs
+757
-755
757 additions, 755 deletions
source/dom/updater.mjs
with
757 additions
and
755 deletions
source/dom/updater.mjs
+
757
−
755
View file @
5b164772
...
@@ -290,8 +290,9 @@ function getControlEventHandler() {
...
@@ -290,8 +290,9 @@ function getControlEventHandler() {
if
(
element
===
undefined
)
{
if
(
element
===
undefined
)
{
return
;
return
;
}
}
setTimeout
(()
=>
{
retrieveAndSetValue
.
call
(
this
,
element
);
retrieveAndSetValue
.
call
(
this
,
element
)
},
0
);
};
};
return
this
[
symbol
];
return
this
[
symbol
];
...
@@ -305,6 +306,7 @@ function getControlEventHandler() {
...
@@ -305,6 +306,7 @@ function getControlEventHandler() {
* @private
* @private
*/
*/
function
retrieveAndSetValue
(
element
)
{
function
retrieveAndSetValue
(
element
)
{
const
pathfinder
=
new
Pathfinder
(
this
[
internalSymbol
].
subject
.
getSubject
());
const
pathfinder
=
new
Pathfinder
(
this
[
internalSymbol
].
subject
.
getSubject
());
let
path
=
element
.
getAttribute
(
ATTRIBUTE_UPDATER_BIND
);
let
path
=
element
.
getAttribute
(
ATTRIBUTE_UPDATER_BIND
);
...
@@ -936,7 +938,7 @@ function addObjectWithUpdaterToElement(elements, symbol, object) {
...
@@ -936,7 +938,7 @@ function addObjectWithUpdaterToElement(elements, symbol, object) {
const
cb
=
this
?.[
updaterTransformerMethodsSymbol
]
const
cb
=
this
?.[
updaterTransformerMethodsSymbol
]
if
(
this
instanceof
HTMLElement
&&
(
typeof
cb
===
"
function
"
))
{
if
(
this
instanceof
HTMLElement
&&
(
typeof
cb
===
"
function
"
))
{
let
callbacks
=
cb
(
);
let
callbacks
=
cb
.
call
(
this
);
if
(
typeof
callbacks
===
"
object
"
)
{
if
(
typeof
callbacks
===
"
object
"
)
{
for
(
const
[
name
,
callback
]
of
Object
.
entries
(
callbacks
))
{
for
(
const
[
name
,
callback
]
of
Object
.
entries
(
callbacks
))
{
if
(
typeof
callback
===
"
function
"
)
{
if
(
typeof
callback
===
"
function
"
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment