mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 11:00:03 -03:30
Add display of multi-select options in survey preview
This commit is contained in:
parent
5f5a91a72c
commit
89c01475f5
@ -665,6 +665,10 @@ angular.module('Utilities', ['RestServices', 'Utilities'])
|
||||
// Don't toggle the dropdown when a multiselect option is
|
||||
// being removed
|
||||
if (multiple) {
|
||||
if (params.disabledOptions) {
|
||||
$(element).on('select2:selecting', e => e.preventDefault());
|
||||
}
|
||||
|
||||
$(element).on('select2:opening', (e) => {
|
||||
var unselecting = $(e.target).data('select2-unselecting');
|
||||
if (unselecting === true) {
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
import {templateUrl} from '../../../shared/template-url/template-url.factory';
|
||||
|
||||
function link($timeout, CreateSelect2, scope, element, attrs, ngModel) {
|
||||
|
||||
$timeout(function() {
|
||||
|
||||
// select2-ify the dropdown. If the preview flag is passed here
|
||||
@ -13,12 +12,13 @@ function link($timeout, CreateSelect2, scope, element, attrs, ngModel) {
|
||||
// and we don't actually need the dropdown portion. Note that the custom
|
||||
// dropdown adapter is used to get the dropdown contents to show up in
|
||||
// a modal.
|
||||
|
||||
CreateSelect2({
|
||||
element: element.find('select'),
|
||||
multiple: scope.isMultipleSelect(),
|
||||
customDropdownAdapter: scope.preview ? false : true
|
||||
customDropdownAdapter: scope.preview ? false : true,
|
||||
disabledOptions: true
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@ -11,8 +11,7 @@
|
||||
choices="choices"
|
||||
ng-required="isRequired === 'true'"
|
||||
ng-model="defaultValue"
|
||||
ng-disabled="isDisabled === 'true'"
|
||||
preview="preview">
|
||||
ng-disabled="isDisabled === 'false'">
|
||||
</multiple-choice>
|
||||
</div>
|
||||
<div ng-if="question.type === 'password'" class="input_area input-group">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user