crash on null element
Closed this issue · 3 comments
yonatanLehman commented
I'm using insertQ to disable intercom when doing a visual test of my site.
if (intercomState == "false") {
insertionQ('#intercom-container').every(function(element){
document.getElementById("intercom-container").style.display = "none";
})
}
I patched/fixed it by testing for null/undefined as the first line of tagAll and it solved the problem
function tagAll(e) {
if (!e) return;
BTW1 - the intercome icon still shows up briefly - is there a way to make it invisible before it appears?
BTW2 - I assume I could have written
element.style.display = "none" - correct ?
Thanks for this feature - it saved me..
naugtur commented
Would you like to turn this into a pull request? If it's a single line, it should be doable through github UI. Would be nice to see you in the contributor list for that.
And yes, element
is the element on which the event fired, so it has to match your initial selector.
yonatanLehman commented
Will do.
בתאריך יום ג׳, 10 בספט׳ 2019, 22:44, מאת Zbyszek Tenerowicz <
notifications@github.com>:
… Would you like to turn this into a pull request? If it's a single line, it
should be doable through github UI. Would be nice to see you in the
contributor list for that.
And yes, element is the element on which the event fired, so it has to
match your initial selector.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#32?email_source=notifications&email_token=AH2RHBGVFK4OXHOUTQMMYVDQI72KNA5CNFSM4IU3LIP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6MITTQ#issuecomment-530090446>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AH2RHBBDLM6WQT4MII7VMHDQI72KNANCNFSM4IU3LIPQ>
.
naugtur commented
merged