Show empty value for Menu and display an asterisk next to the default menu (fixes #391)

This commit is contained in:
Djamil Legato
2015-05-29 15:25:02 -07:00
parent 817d53b757
commit d5c6af940a
4 changed files with 8 additions and 5 deletions
+4 -2
View File
@@ -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
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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 %}