Position of included script

瀏覽次數:20 次
跳到第一則未讀訊息

Oleksandr Mandryk

未讀,
2017年5月28日 下午5:14:572017/5/28
收件者:TopBraid Suite Users
Hi all,
I need to add custom JS file to the taxonomy page (where we can see tabs General, Metadata, Manage, ...).

In my .ui.ttlx file I've created sub-class of uiScripts, added "<script src=...'' tag" to ui:prototype, 
and added this class to ui:includeScript of swa:Elements (right after swa:jQueryScript).

After this my script appeared in the head section of the taxonomy page but on the very beginning.

Because it's functionality depends on jQuery library, I would like to put it in the end of head tag. 
So the question is how can I do it?

BTW: I've also tried to add it to teamwork:Elements (because _viewClass=teamwork%3AProjectPage) but my script haven't appear in the Head section at all.

I've also tried to play with ui:dependsOn for my script asset but it also doesn't work.

Thank you!

Holger Knublauch

未讀,
2017年5月28日 下午6:44:172017/5/28
收件者:topbrai...@googlegroups.com
Hi Oleksandr,

we have moved away from using ui:Scripts for our default assets (including jQuery), so it would not be possible to explicitly declare a dependency on that. Instead, all these are attached to swa:Elements. The order of insertion implies that the best way would be to declare a subclass of swa:Elements and add the <script> into ui:headIncludes of that subclass. Have you tried that approach (instead of ui:includeScript)? If yes, and you're still stuck, please send the relevant parts of the class hierarchy along.

Thanks,
Holger
--
You received this message because you are subscribed to the Google Group "TopBraid Suite Users", the topics of which include the TopBraid Suite family of products and its base technologies such as SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to topbrai...@googlegroups.com
---
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Oleksandr Mandryk

未讀,
2017年5月30日 凌晨3:09:292017/5/30
收件者:TopBraid Suite Users
Hi Holger,

Thank you for you answer! 
I've managed to solve my problem by adding my scripts to the ui:headIncludes in the teamwork:RestrictedPage :)

Best regards,
Oleksandr Mandryk
回覆所有人
回覆作者
轉寄
0 則新訊息