mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 19:43:16 +00:00
fix choose option
This commit is contained in:
@@ -197,6 +197,8 @@ class databox_subdefsStructure implements IteratorAggregate, Countable
|
|||||||
$subdef = $dom_struct->createElement('subdef');
|
$subdef = $dom_struct->createElement('subdef');
|
||||||
$subdef->setAttribute('class', $class);
|
$subdef->setAttribute('class', $class);
|
||||||
$subdef->setAttribute('name', mb_strtolower($name));
|
$subdef->setAttribute('name', mb_strtolower($name));
|
||||||
|
|
||||||
|
$preset = ($preset == 'Choose') ? 'Custom' : $preset ;
|
||||||
$subdef->setAttribute('presets', $preset);
|
$subdef->setAttribute('presets', $preset);
|
||||||
|
|
||||||
$mediaTypeElement = $dom_struct->createElement('mediatype');
|
$mediaTypeElement = $dom_struct->createElement('mediatype');
|
||||||
|
@@ -227,6 +227,17 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isOptionChosen(o) {
|
||||||
|
console.log(o.val());
|
||||||
|
if (o.val() != 'Choose') {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
o.addClass("ui-state-error");
|
||||||
|
updateTips("Choose an option");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function checkPresence(mediaType, o) {
|
function checkPresence(mediaType, o) {
|
||||||
|
|
||||||
var el = $('input[name="subdefs[]"][value="' + mediaType + '_' + o.val() + '"]');
|
var el = $('input[name="subdefs[]"][value="' + mediaType + '_' + o.val() + '"]');
|
||||||
@@ -268,6 +279,8 @@
|
|||||||
allFields.removeClass("ui-state-error");
|
allFields.removeClass("ui-state-error");
|
||||||
|
|
||||||
bValid = bValid && checkLength(name, "subdef name", 3, 16);
|
bValid = bValid && checkLength(name, "subdef name", 3, 16);
|
||||||
|
bValid = bValid && isOptionChosen(subviewType);
|
||||||
|
bValid = bValid && isOptionChosen(mediaType);
|
||||||
bValid = bValid && checkSpecialChar(name);
|
bValid = bValid && checkSpecialChar(name);
|
||||||
bValid = bValid && checkPresence(subviewType.val(), name);
|
bValid = bValid && checkPresence(subviewType.val(), name);
|
||||||
bValid = bValid && isNotEmpty(subviewPath);
|
bValid = bValid && isNotEmpty(subviewPath);
|
||||||
|
Reference in New Issue
Block a user