Passed
Pull Request — dev/6.0.0 (#296)
by Sudar
13:50 queued 09:51
created

assets/js/src/bulk-delete-post-type.js   A

Complexity

Total Complexity 3
Complexity/F 1.5

Size

Lines of Code 15
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 0
wmc 3
c 2
b 0
f 0
nc 1
mnd 1
bc 3
fnc 2
dl 0
loc 15
rs 10
bpm 1.5
cpm 1.5
noi 0
1
jQuery( document ).ready( function () {
2
	jQuery( '.select2-post' ).select2( {
3
		width: '300px',
4
		templateSelection: function (state) {
5
			if (!state.id) {
6
				return state.text;
7
			}
8
			var parentLabel = state.element.parentElement.label;
9
			var $state = jQuery(
10
				'<span>' + parentLabel + '-' + state.text + '</span>'
11
			);
12
			return $state;
13
		}
14
	});
15
});