1define('jira/field/init-priority-pickers', ['jira/ajs/select/single-select', 'jira/util/events/reasons', 'jira/util/events/types', 'jira/util/events', 'jira/searchers/element/priority-picker-options', 'jquery'], function (SingleSelect, Reasons, Types, Events, priorityPickerOptions, $) { 2 'use strict'; 3 4 function getActiveProjectId($context, el, index) { 5 var $project = $context.find(".project-field, .project-field-readonly"); 6 return $project.length > 1 ? $project.eq(index - 1).val() : el.dataset.projectId; 7 } 8 function createPriorityPicker($context) { 9 $context.find("select#priority").each(function (i, el) { 10 var options = { 11 element: el, 12 revertOnInvalid: true 13 }; 14 var ariaLabel = $.attr(el, 'aria-label'); 15 if (ariaLabel) { 16 options.ariaLabel = ariaLabel; 17 } 18 if (el.dataset.useRestEndpoint) { 19 var projectId = getActiveProjectId($context, el, i); 20 if (projectId) { 21 options.baseAjaxOptions = { 22 projectIds: projectId 23 }; 24 } 25 new SingleSelect(priorityPickerOptions(options)); 26 } else { 27 new SingleSelect(options); 28 } 29 }); 30 } 31 Events.bind(Types.NEW_CONTENT_ADDED, function (e, context, reason) { 32 //eslint-disable-line @atlassian/jira-event-checks/no-newcontentadded-handlers 33 if (reason !== Reasons.panelRefreshed) { 34 createPriorityPicker(context); 35 } 36 }); 37});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.