Skip to content

Commit

Permalink
fix ajax js to use updater and fade in instead of pop
Browse files Browse the repository at this point in the history
  • Loading branch information
aheadley committed Jan 10, 2013
1 parent abb17ee commit a5a5690
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions app/design/frontend/base/default/template/turpentine/ajax.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,31 @@ if( $ajaxDebugEnabled ) {
* @link https://prototypejs.org/doc/latest/ajax/index.html
* @link https://prototypejs.org/doc/latest/ajax/Ajax/Request/index.html
* @link https://prototypejs.org/doc/latest/dom/Element/replace/index.html
* @link https://madrobby.github.com/scriptaculous/effect-appear/
*/
echo sprintf( '<div id="%s" style="display: none">
<script type="text/javascript">
new Ajax.Request("%s", {
method: "get",
onCreate: function(request) {
request.transport.setRequestHeader = Prototype.emptyFunction;
},
on200: function(response) {
Element.replace($("%s"), response.responseText);
new Ajax.Updater(
"%s",
"%s",
{
method: "get",
evalScripts: true,
onComplete: function(transport) {
$("%s").appear({
duration: 0.3
});
}
}
});
);
</script>
</div>',
</div>
',
$blockTag,
$blockTag,
$this->getAjaxUrl(),
$blockTag ) . PHP_EOL;
$blockTag
);
if( $ajaxDebugEnabled ) {
echo sprintf( '<!-- AJAX END [%s] -->', $this->getNameInLayout() ) . PHP_EOL;
}

0 comments on commit a5a5690

Please sign in to comment.