mirror of
https://github.com/gantry/gantry5.git
synced 2026-08-19 01:15:04 -05:00
Show empty value for Menu and display an asterisk next to the default menu (fixes #391)
This commit is contained in:
@@ -27,8 +27,10 @@ form:
|
||||
label: Menu
|
||||
description: Select menu to be used with the particle.
|
||||
default: ''
|
||||
selectize:
|
||||
allowEmptyOption: true
|
||||
options:
|
||||
'': -- Select Menu --
|
||||
'': Use Default Menu
|
||||
|
||||
startLevel:
|
||||
type: input.text
|
||||
@@ -46,4 +48,4 @@ form:
|
||||
type: input.checkbox
|
||||
label: Mobile Target
|
||||
description: Check this field if you want this menu to become the target for Mobile Menu and to appear in Offcanvas
|
||||
default: 0
|
||||
default: 0
|
||||
|
||||
@@ -1536,7 +1536,7 @@ var Selectize = new prime({
|
||||
|
||||
registerOption: function(data) {
|
||||
var key = hash_key(data[this.options.valueField]);
|
||||
if (!key || this.options.hasOwnProperty(key)) return false;
|
||||
if ((!key || this.options.hasOwnProperty(key)) && !this.options.allowEmptyOption) return false;
|
||||
data.$order = data.$order || ++this.order;
|
||||
this.Options[key] = data;
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -10502,7 +10502,7 @@ var Selectize = new prime({
|
||||
|
||||
registerOption: function(data) {
|
||||
var key = hash_key(data[this.options.valueField]);
|
||||
if (!key || this.options.hasOwnProperty(key)) return false;
|
||||
if ((!key || this.options.hasOwnProperty(key)) && !this.options.allowEmptyOption) return false;
|
||||
data.$order = data.$order || ++this.order;
|
||||
this.Options[key] = data;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
{% block options %}
|
||||
{{ parent() }}
|
||||
{% set current = gantry.menu.getDefaultMenuName() %}
|
||||
{% for key in gantry.menu.getMenus() %}
|
||||
{% set text = key|capitalize %}
|
||||
<option
|
||||
@@ -10,6 +11,6 @@
|
||||
value="{{ key|e }}"
|
||||
{# non-gloval attribute structures #}
|
||||
{% if field.options.disabled in ['on', 'true', 1] %}disabled="disabled"{% endif %}
|
||||
>{{ text|e }}</option>
|
||||
>{{ text|e }}{{ current == key ? ' *' : '' }}</option>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user