Skip to content

Instantly share code, notes, and snippets.

@prototech
Created April 8, 2014 05:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prototech/10095306 to your computer and use it in GitHub Desktop.
Save prototech/10095306 to your computer and use it in GitHub Desktop.
$('[data-ajax]').each(function() {
var $this = $(this),
ajax = $this.attr('data-ajax'),
filter = $this.attr('data-filter'),
fn;
if (ajax !== 'false') {
fn = (ajax !== 'true') ? ajax : null;
filter = (filter !== undefined) ? phpbb.getFunctionByName(filter) : null;
phpbb.ajaxify({
selector: this,
refresh: $this.attr('data-refresh') !== undefined,
filter: filter,
callback: fn
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment