• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Having issues with TopCtrl and OverlayTrigger AJAX...

Jaxel

Well-known member
#1
Okay, so I have on my portal, a TopCtrl button called "Promote Thread".

1.jpg

When you click on the TopCtrl, it brings up an OverlayTrigger...

2.jpg

When you submit the promote thread overlay trigger, it runs through and sends the data back via AJAX to prevent page reload. This is a problem with this however... in addition to the word "Promote Thread" on the TopCtrl, there is also a <span> tag.

Using AJAX, I can easily replace "Promote Thread" with "Promote Options", but I can't replace the <span> tags; they get lost in the transition. If I force the <span> insert in the controller, the javascript just changes < and > to &lt; and &gt;.

3.jpg
Code:
return $this->responseRedirect(
    XenForo_ControllerResponse_Redirect::SUCCESS,
    XenForo_Link::buildPublicLink('threads', $thread),
    null,
    array('linkPhrase' => '<span>'.new XenForo_Phrase('promote_options').'</span>')
);
Is there any way to fix this?
 
#3
I suppose that if you put the span tags inside the phrase, you will get the same result?
I meen
array('linkPhrase' => new XenForo_Phrase('promote_options'))
(where phrase promote_options contains the span...)

Just a thought.. probably wont work.
Luc

But i vaguely remember having a similar problem long long time ago.
the solution was per javascript.
putting the phrase into a variable in the final template.. and doing the replacement with javascript in the response part.