Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Failed Conditions
Pull Request — master (#1101)
by Dan
05:32
created

uni_gen.js ➔ setupDragDrop   A

Complexity

Conditions 3

Size

Total Lines 26
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 16
c 0
b 0
f 0
dl 0
loc 26
rs 9.6
1
"use strict";
2
3
// Install drag & drop handlers once the page has finished loading
4
window.onload = function() {
5
	setupDragDrop();
6
};
7
8
/**
9
 * Allows locations to be dragged and dropped to different sectors
10
 * with an AJAX update.
11
 *
12
 * This needs to be called every time the elements in the sector map
13
 * update, to install new handlers on the updated elements.
14
 */
15
function setupDragDrop() {
16
17
	// Make the Location images draggable elements
18
	$(".drag_loc").draggable({
19
		addClasses: false,
20
		revert: "invalid",
21
		cursor: "move",
22
	});
23
24
	// The draggable elements can be dropped into any sector
25
	$(".lm_sector").droppable({
26
		addClasses: false,
27
		accept: ".drag_loc",
28
		drop: function(event, ui) {
29
			var href = ui.draggable.data("href");
30
			var data = {
31
				ajax: 1,
32
				TargetSectorID: $(this).find(".lmsector").text(),
33
				OrigSectorID: ui.draggable.data("sector"),
34
				LocationTypeID: ui.draggable.data("loc"),
35
			};
36
			ajaxLink(href, setupDragDrop, data);
37
		},
38
	});
39
40
}
41