1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-01 06:20:46 +02:00

[ticket/10949] Converted AJAX coding standards to new guidelines.

Basically, moved parentheses to same line and changed variable names to
camel case.

PHPBB3-10949
This commit is contained in:
Callum Macrae
2012-06-21 19:16:05 +01:00
parent e045a80d8d
commit d5a788ae5b
2 changed files with 86 additions and 131 deletions

View File

@@ -5,14 +5,12 @@
// This callback finds the post from the delete link, and removes it.
phpbb.add_ajax_callback('post_delete', function() {
var el = $(this),
post_id;
postId;
if (el.attr('data-refresh') === undefined)
{
post_id = el[0].href.split('&p=')[1];
var post = el.parents('#p' + post_id).css('pointer-events', 'none');
if (post.hasClass('bg1') || post.hasClass('bg2'))
{
if (el.attr('data-refresh') === undefined) {
postId = el[0].href.split('&p=')[1];
var post = el.parents('#p' + postId).css('pointer-events', 'none');
if (post.hasClass('bg1') || post.hasClass('bg2')) {
var posts1 = post.nextAll('.bg1');
post.nextAll('.bg2').removeClass('bg2').addClass('bg1');
posts1.removeClass('bg1').addClass('bg2');
@@ -54,8 +52,7 @@ $('[data-ajax]').each(function() {
ajax = $this.attr('data-ajax'),
fn;
if (ajax !== 'false')
{
if (ajax !== 'false') {
fn = (ajax !== 'true') ? ajax : null;
phpbb.ajaxify({
selector: this,
@@ -89,12 +86,9 @@ phpbb.ajaxify({
filter: function (data) {
var action = $('#quick-mod-select').val();
if (action === 'make_normal')
{
if (action === 'make_normal') {
return $(this).find('select option[value="make_global"]').length > 0;
}
else if (action === 'lock' || action === 'unlock')
{
} else if (action === 'lock' || action === 'unlock') {
return true;
}