Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2018-08-16 13:58:07

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

[Solved] Send and execute a jQuery script on an ajax call

Hi,
In the last Bêta version of oui_player I added a player preview in the admin Write tab.
It is associated with a defined field containing the play attribute value (a Youtube URL or whatever…) of the main plugin tag.
The field is often a custom one (can also be the article_image one) and as there is only one pluggable_ui() related event for all custom fields, I send a jQuery line with the player to move it just under the right field.
However, while I thought it was working, I just noticed that the script is not executed on saving and the player stay at the bottom of the custom fields related “panel”. I tried a couple of solutions without any success.
Any idea to make it work on Ajax calls ?

$(function() { $(".' . $class . '").css("margin-top", "1em").insertAfter("#' . $inputID . '"); });

Thanks!

Last edited by NicolasGraph (2018-08-20 08:17:19)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#2 2018-08-20 08:19:42

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: [Solved] Send and execute a jQuery script on an ajax call

I finally attached the script the article event related callback and It works nicely.


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

Board footer

Powered by FluxBB