fix: Fixed an issue with the type restrictions, fixes #1603

- fixes an issue where the type list in the attribute add/edit view wouldn't automatically restrict to the valid options
pull/1610/head
Iglocska 2016-10-10 09:22:18 +02:00
parent 6e4ade823f
commit 07a358eed9
4 changed files with 7 additions and 28 deletions

View File

@ -46,7 +46,7 @@ class AppController extends Controller {
public $helpers = array('Utility');
private $__jsVersion = '2.4.51';
private $__jsVersion = '2.4.52';
public $phpmin = '5.5.9';
public $phprec = '5.6.0';

View File

@ -138,17 +138,6 @@ var category_type_mapping = new Array();
}
?>
function formCategoryChanged(id) {
// fill in the types
var options = $('#AttributeType').prop('options');
$('option', $('#AttributeType')).remove();
$.each(category_type_mapping[$('#AttributeCategory').val()], function(val, text) {
options[options.length] = new Option(text, val);
});
// enable the form element
$('#AttributeType').prop('disabled', false);
}
$(document).ready(function() {
initPopoverContent('Attribute');
$('#AttributeDistribution').change(function() {

View File

@ -95,17 +95,6 @@ var category_type_mapping = new Array();
}
?>
function formCategoryChanged(id) {
// fill in the types
var options = $('#AttributeType').prop('options');
$('option', $('#AttributeType')).remove();
$.each(category_type_mapping[$('#AttributeCategory').val()], function(val, text) {
options[options.length] = new Option(text, val);
});
// enable the form element
$('#AttributeType').prop('disabled', false);
}
$(document).ready(function() {
initPopoverContent('Attribute');
$('#AttributeDistribution').change(function() {

View File

@ -2529,14 +2529,15 @@ function getFormInfoContent(property, field) {
return content;
}
function formCategoryChanged(context) {
var options = $('#' + context + 'Type').prop('options');
$('option', $('#' + context + 'Type')).remove();
$.each(category_type_mapping[$('#' + context + 'Category').val()], function(val, text) {
function formCategoryChanged(id) {
// fill in the types
var options = $('#AttributeType').prop('options');
$('option', $('#AttributeType')).remove();
$.each(category_type_mapping[$('#AttributeCategory').val()], function(val, text) {
options[options.length] = new Option(text, val);
});
// enable the form element
$('#' + context + 'Type').prop('disabled', false);
$('#AttributeType').prop('disabled', false);
}
function malwareCheckboxSetter(context) {