1. 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...

Discussion in 'XenForo Development Discussions' started by Jaxel, Aug 16, 2011.

  1. Jaxel

    Jaxel Well-Known Member

    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?
     
  2. Cezz

    Cezz Well-Known Member

    As a user of your portal software I would also love to know an answer to this...
     
  3. Luciano

    Luciano Member

    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.
     

Share This Page