Some fixes for code climate.

This commit is contained in:
James Cole 2016-01-22 07:27:49 +01:00
parent 19dc91937e
commit 8743b49a17
4 changed files with 10 additions and 7 deletions

View File

@ -3,6 +3,7 @@ languages:
JavaScript: true
PHP: true
exclude_paths:
- "gulpfile.js"
- "public/packages/maximebf/php-debugbar/debugbar.js"
- "public/packages/maximebf/php-debugbar/widgets.js"
- "public/packages/maximebf/php-debugbar/openhandler.js"

View File

@ -4,6 +4,7 @@
// Return a helper with preserved width of cells
var fixHelper = function(e, tr)
{
"use strict";
var $originals = tr.children();
var $helper = tr.clone();
$helper.children().each(function(index)
@ -84,4 +85,4 @@ function sortStop(event, ui) {
//check if the item above OR under this one have the same date
//if not. return false
}
}

View File

@ -1,3 +1,4 @@
/* global $, addNewTrigger, addNewAction, actionCount, triggerCount */
/*
* edit.js
* Copyright (C) 2016 Sander Dorigo
@ -11,10 +12,10 @@
$(function () {
"use strict";
console.log("edit");
if (triggerCount == 0) {
if (triggerCount === 0) {
addNewTrigger();
}
if (actionCount == 0) {
if (actionCount === 0) {
addNewAction();
}

View File

@ -9,6 +9,7 @@
// Return a helper with preserved width of cells
var fixHelper = function (e, tr) {
"use strict";
var $originals = tr.children();
var $helper = tr.clone();
$helper.children().each(function (index) {
@ -53,18 +54,17 @@ function sortStop(event, ui) {
var id = trigger.data('id');
var order = i + 1;
entries.push(id);
//console.log('Entry #' + id + ' will get order ' + order + ' in rule ' + ruleId + '.');
});
if (parent.hasClass('rule-triggers')) {
$.post('rules/rules/trigger/reorder/' + ruleId, {_token: token, triggers: entries}).fail(function () {
alert('Could not re-order rule triggers. Please refresh the page.')
alert('Could not re-order rule triggers. Please refresh the page.');
});
} else {
$.post('rules/rules/action/reorder/' + ruleId, {_token: token, actions: entries}).fail(function () {
alert('Could not re-order rule actions. Please refresh the page.')
alert('Could not re-order rule actions. Please refresh the page.');
});
}
}
}