Update javascript code.

This commit is contained in:
James Cole
2017-01-02 08:30:20 +01:00
parent 3cd0540474
commit 533797fc9e
23 changed files with 24 additions and 110 deletions

View File

@@ -11,12 +11,6 @@
var triggerCount = 0;
var actionCount = 0;
$(function () {
"use strict";
console.log('edit-create');
});
function addNewTrigger() {
"use strict";
triggerCount++;
@@ -41,7 +35,6 @@ function addNewAction() {
actionCount++;
$.getJSON('json/action', {count: actionCount}).done(function (data) {
//console.log(data.html);
$('tbody.rule-action-tbody').append(data.html);
// add action things.

View File

@@ -10,7 +10,6 @@
$(function () {
"use strict";
console.log("create");
if (triggerCount === 0) {
addNewTrigger();
}

View File

@@ -10,8 +10,6 @@
$(function () {
"use strict";
console.log("edit");
if (triggerCount === 0) {
addNewTrigger();
}

View File

@@ -48,7 +48,6 @@ function sortStop(event, ui) {
var ruleId = current.parent().data('id');
var entries = [];
// who am i?
console.log('Rule: #' + current.parent().data('id'));
$.each(parent.children(), function (i, v) {
var trigger = $(v);
@@ -58,11 +57,11 @@ function sortStop(event, ui) {
});
if (parent.hasClass('rule-triggers')) {
$.post('rules/trigger/order/' + ruleId, {_token: token, triggers: entries}).fail(function () {
$.post('rules/trigger/order/' + ruleId, {triggers: entries}).fail(function () {
alert('Could not re-order rule triggers. Please refresh the page.');
});
} else {
$.post('rules/action/order/' + ruleId, {_token: token, actions: entries}).fail(function () {
$.post('rules/action/order/' + ruleId, {actions: entries}).fail(function () {
alert('Could not re-order rule actions. Please refresh the page.');
});