Merge pull request #133 from bencroker/patch-13

Fixed `swapSpec` when `view`
This commit is contained in:
chg20 2020-07-06 09:25:28 -07:00 committed by GitHub
commit 83e20394ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1338,7 +1338,7 @@ return (function () {
swapSpec["scroll"] = modifier.substr(7);
}
if (modifier.indexOf("view:") === 0) {
swapSpec["view"] = modifier.substr(7);
swapSpec["view"] = modifier.substr(5);
}
}
}
@ -1374,10 +1374,10 @@ return (function () {
}
}
if (swapSpec.view) {
if (swapSpec.scroll === "top") {
if (swapSpec.view === "top") {
target.scrollIntoView(true);
}
if (swapSpec.scroll === "bottom") {
if (swapSpec.view === "bottom") {
target.scrollIntoView(false);
}
}