Last active
March 24, 2018 05:55
-
-
Save aanchalsikka/2c64ae131eb0529d9908305db4ca4791 to your computer and use it in GitHub Desktop.
Checkbox for schema editor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var allCheckbox = $('[data-metatype=checkbox]', $form); | |
allCheckbox.each(function (index, checkbox) { | |
var $checkbox = $(checkbox); | |
if($checkbox.is(":checked")){ | |
$checkbox.attr('value','true'); | |
} | |
// Add false to checkbox if asset is not opened in bulk metadata editor | |
// see https://jira.corp.adobe.com/browse/CQ-98699 for details . | |
// in bulk metadata editor only checked state is considered. | |
else if(!($(".foundation-collection").data("foundation-selections-mode")=="multiple")){ | |
$checkbox.attr('value','false'); | |
} | |
var typeHint = $checkbox.data('typehint'); | |
if (!typeHint) { | |
typeHint = 'Boolean'; | |
} | |
var name = $checkbox.attr('name'); | |
hintFields.push({ | |
'name': name + '@TypeHint', | |
'value': typeHint | |
}); | |
}); | |
var allMetatypeCheckbox = $('coral-checkbox[data-metatype=checkbox]', $form); | |
allMetatypeCheckbox.each(function (index, coralCheckbox) { | |
var $coralCheckbox = $(coralCheckbox); | |
var $checkbox = $coralCheckbox.find("input[type='checkbox']"); | |
if($checkbox){ | |
if($checkbox.is(":checked")){ | |
$checkbox.attr('value','true'); | |
} | |
// Add false to checkbox if asset is not opened in bulk metadata editor | |
// see https://jira.corp.adobe.com/browse/CQ-98699 for details . | |
// in bulk metadata editor only checked state is considered. | |
else if(!($(".foundation-collection").data("foundation-selections-mode")=="multiple")){ | |
$checkbox.attr('value','false'); | |
} | |
var typeHint = $checkbox.data('typehint'); | |
if (!typeHint) { | |
typeHint = 'Boolean'; | |
} | |
var name = $checkbox.attr('name'); | |
hintFields.push({ | |
'name': name + '@TypeHint', | |
'value': typeHint | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment