Commit 6dce79cc authored by KR Moorhouse's avatar KR Moorhouse Committed by GitHub

Merge pull request #3080 from wpninjas/issue#2824

Add support for setting multiselect size. 
parents e1a2573b 5a9e1bab
......@@ -93,6 +93,9 @@ define([], function() {
if( 'listmultiselect' == this.type ){
otherAttributes = otherAttributes + ' multiple';
var multiSize = this.multi_size || 5;
otherAttributes = otherAttributes + ' size="' + multiSize + '"';
}
return otherAttributes;
......@@ -133,4 +136,4 @@ define([], function() {
});
return controller;
} );
\ No newline at end of file
} );
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -611,6 +611,22 @@ return apply_filters( 'ninja_forms_field_settings', array(
'help' => __( 'This column in the submissions table will sort by number.', 'ninja-forms' ),
),
/*
|--------------------------------------------------------------------------
| Display Settings
|--------------------------------------------------------------------------
*/
// Multi-Select List Only
'multi_size' => array(
'name' => 'multi_size',
'type' => 'number',
'label' => __( 'Multi-Select Box Size', 'ninja-forms'),
'width' => 'one-half',
'group' => 'primary',
'value' => 5,
),
/*
|--------------------------------------------------------------------------
| Un-Grouped Settings
......
......@@ -17,6 +17,8 @@ class NF_Fields_ListMultiselect extends NF_Abstracts_List
protected $_old_classname = 'list-multiselect';
protected $_settings = array( 'multi_size' );
public function __construct()
{
parent::__construct();
......@@ -51,4 +53,4 @@ class NF_Fields_ListMultiselect extends NF_Abstracts_List
}
return $value;
}
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment