diff --git a/themes/grav/js/admin-all.js b/themes/grav/js/admin-all.js index cc389de0..96ee77c8 100644 --- a/themes/grav/js/admin-all.js +++ b/themes/grav/js/admin-all.js @@ -18,6 +18,8 @@ var bytesToSize = function(bytes) { return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[i]; }; +var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1; + $(function () { jQuery.substitute = function(str, sub) { return str.replace(/\{(.+?)\}/g, function($0, $1) { @@ -71,7 +73,8 @@ $(function () { startAngle: 0, total: 100, showLabel: false, - height: 150 + height: 150, + chartPadding: !isFirefox ? 5 : 10 }; UpdatesChart = Chartist.Pie('.updates-chart .ct-chart', data, options); @@ -436,10 +439,13 @@ $(function () { template = el.find('[data-collection-template="new"]').html(); // make sortable - new Sortable(holder[0], { onUpdate: function () { - if (isArray) - reIndex(el); - } }); + new Sortable(holder[0], { + filter: '.form-input-wrapper', + onUpdate: function () { + if (isArray) + reIndex(el); + } + }); // hook up delete el.on('click', '[data-action="delete"]', function (e) { diff --git a/themes/grav/js/pages-all.js b/themes/grav/js/pages-all.js index 69172579..acf0e7b4 100644 --- a/themes/grav/js/pages-all.js +++ b/themes/grav/js/pages-all.js @@ -163,8 +163,14 @@ $(function(){ $('input[name="folder"]').on('input', function(e){ + var start = this.selectionStart, + end = this.selectionEnd; + value = $(this).val().toLowerCase().replace(/\s/g, '-').replace(/[^a-z0-9_\-]/g, ''); $(this).val(value); + + // restore cursor position + this.setSelectionRange(start, end); }); childrenToggles.on('click', function () { diff --git a/themes/grav/templates/dashboard.html.twig b/themes/grav/templates/dashboard.html.twig index 544c6d0d..013cb5e4 100644 --- a/themes/grav/templates/dashboard.html.twig +++ b/themes/grav/templates/dashboard.html.twig @@ -52,7 +52,8 @@ startAngle: 0, total: 100, showLabel: false, - height: 150 + height: 150, + chartPadding: !isFirefox ? 5 : 10 }; Chartist.Pie('.backups-chart .ct-chart', data, options); @@ -80,7 +81,7 @@ }; var options = { height: 164, - chartPadding:5, + chartPadding: !isFirefox ? 5 : 25, axisX: { showGrid: false, diff --git a/themes/grav/templates/forms/fields/array/array.html.twig b/themes/grav/templates/forms/fields/array/array.html.twig index 44de8244..9c102f09 100644 --- a/themes/grav/templates/forms/fields/array/array.html.twig +++ b/themes/grav/templates/forms/fields/array/array.html.twig @@ -15,7 +15,7 @@ {% if field.value_only != true %} {% endif %} - + diff --git a/themes/grav/templates/pages.html.twig b/themes/grav/templates/pages.html.twig index ae53065f..e8d2826f 100644 --- a/themes/grav/templates/pages.html.twig +++ b/themes/grav/templates/pages.html.twig @@ -11,7 +11,7 @@ {% if context.exists %} {% set page_url = base_url ~ '/pages' ~ (context.header.routes.default ?: context.rawRoute) %} {% set exists = true %} - {% set title = (context.exists ? "PLUGIN_ADMIN.EDIT"|tu : "PLUGIN_ADMIN.CREATE"|tu ) ~ " " ~ context.header.title %} + {% set title = (context.exists ? "PLUGIN_ADMIN.EDIT"|tu : "PLUGIN_ADMIN.CREATE"|tu ) ~ " " ~ (context.header.title ?: context.title) %} {% else %} {% set title = "PLUGIN_ADMIN.ADD_PAGE"|tu %} {% endif %} @@ -319,4 +319,3 @@ {% endblock %} - diff --git a/themes/grav/templates/partials/plugins-list.html.twig b/themes/grav/templates/partials/plugins-list.html.twig index 7a52dab0..42476fed 100644 --- a/themes/grav/templates/partials/plugins-list.html.twig +++ b/themes/grav/templates/partials/plugins-list.html.twig @@ -23,7 +23,7 @@ v{{ plugin.version }} - {% if (not installing and plugin.form.fields.enabled and (plugin.form.fields.enabled.type != 'hidden')) %} + {% if (not installing and (plugin.form.fields.enabled.type != 'hidden')) %}