Total Complexity | 5 |
Complexity/F | 1.67 |
Lines of Code | 25 |
Function Count | 3 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | /* global BulkWP */ |
||
2 | jQuery( document ).ready( function () { |
||
3 | jQuery( '.select2-post' ).select2( { |
||
4 | width: '300px', |
||
5 | templateSelection: function (state) { |
||
6 | if (!state.id) { |
||
7 | return state.text; |
||
8 | } |
||
9 | |||
10 | var parentLabel = state.element.parentElement.label; |
||
11 | var $state = jQuery( |
||
12 | '<span>' + parentLabel + '-' + state.text + '</span>' |
||
13 | ); |
||
14 | |||
15 | return $state; |
||
16 | } |
||
17 | }); |
||
18 | }); |
||
19 | |||
20 | BulkWP.validatePostTypeSelect2 = function(that) { |
||
21 | if (null !== jQuery(that).parent().prev().children().find(".select2-post[multiple]").val()) { |
||
22 | return true; |
||
23 | } else { |
||
24 | return false; |
||
25 | } |
||
26 | }; |
||
27 |