<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Efficy Overflow Q&amp;A - Recent questions tagged afterloaded</title>
<link>https://overflow.efficy.io/?qa=tag/afterloaded</link>
<description>Powered by Question2Answer</description>
<item>
<title>AfterLoaded add pack to docu</title>
<link>https://overflow.efficy.io/?qa=6196/afterloaded-add-pack-to-docu</link>
<description>&lt;p&gt;Hello&lt;/p&gt;

&lt;p&gt;I'm trying to do some custom coding when a user adds a package to a document. I'm trying to edit the AfterLoaded function in docuEdit.js.&lt;/p&gt;

&lt;p&gt;When I call the following code, a list of all packs linked to the document is returned, but the onclick function only works when the pack is selected as main. The second problem with this code is that the list is returned with every change on the document.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var packlink = document.getElementsByName(&quot;Pack-MAIN&quot;);
    console.log(packlink);
    if(packlink) {
        for (var i = 0 ; i &amp;lt; packlink.length ; ++i) {
            packlink[i].onclick = OnPackLinkChanged
        }
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Is there a way for me to know which package is added to the document and only execute the custom code for the package that is added?&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6196/afterloaded-add-pack-to-docu</guid>
<pubDate>Wed, 23 Jun 2021 08:11:47 +0000</pubDate>
</item>
</channel>
</rss>