From 12c423909f721c6f5223007ad5e7ba6c162d63a4 Mon Sep 17 00:00:00 2001 From: Patrick Nelson Date: Mon, 5 Oct 2015 11:26:21 -0400 Subject: [PATCH] FIX (partial) for #3181 where non-submit buttons are being activated on "enter" key press (relates to CMS issue at https://github.com/silverstripe/silverstripe-cms/issues/1288). --- forms/HtmlEditorField.php | 2 +- forms/gridfield/GridFieldSortableHeader.php | 2 +- javascript/GridField.js | 2 +- javascript/UploadField_downloadtemplate.js | 2 +- javascript/UploadField_uploadtemplate.js | 6 +++--- templates/AssetUploadField.ss | 2 +- templates/Includes/HtmlEditorField_viewfile.ss | 4 ++-- templates/Includes/UploadField_FileButtons.ss | 8 ++++---- templates/UploadField.ss | 4 ++-- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/forms/HtmlEditorField.php b/forms/HtmlEditorField.php index d51139c4c..65541ffaa 100644 --- a/forms/HtmlEditorField.php +++ b/forms/HtmlEditorField.php @@ -352,7 +352,7 @@ class HtmlEditorField_Toolbar extends RequestHandler { '

' . sprintf($numericLabelTmpl, '1', _t('HtmlEditorField.ADDURL', 'Add URL')) . '

'), $remoteURL = new TextField('RemoteURL', 'http://'), new LiteralField('addURLImage', - '') ); diff --git a/forms/gridfield/GridFieldSortableHeader.php b/forms/gridfield/GridFieldSortableHeader.php index 67af41e73..d05b68635 100644 --- a/forms/gridfield/GridFieldSortableHeader.php +++ b/forms/gridfield/GridFieldSortableHeader.php @@ -150,7 +150,7 @@ class GridFieldSortableHeader implements GridField_HTMLProvider, GridField_DataM && $gridField->getConfig()->getComponentByType('GridFieldFilterHeader')){ $field = new LiteralField($fieldName, - ''); + ''); } else { $field = new LiteralField($fieldName, '' . $title . ''); } diff --git a/javascript/GridField.js b/javascript/GridField.js index 5472547a8..e45055ee2 100644 --- a/javascript/GridField.js +++ b/javascript/GridField.js @@ -55,7 +55,7 @@ content = ''; self.addClass('show-filter').find('.filter-header').show(); } else { - content = ''; + content = ''; self.removeClass('show-filter').find('.filter-header').hide(); } diff --git a/javascript/UploadField_downloadtemplate.js b/javascript/UploadField_downloadtemplate.js index 43340b201..73709dbfd 100644 --- a/javascript/UploadField_downloadtemplate.js +++ b/javascript/UploadField_downloadtemplate.js @@ -22,7 +22,7 @@ window.tmpl.cache['ss-uploadfield-downloadtemplate'] = tmpl( '' + '{% if (file.error) { %}' + '
' + - '
' + + '
' + '
' + '{% } else { %}' + '
{% print(file.buttons, true); %}
' + diff --git a/javascript/UploadField_uploadtemplate.js b/javascript/UploadField_uploadtemplate.js index 3df123759..c54851e90 100644 --- a/javascript/UploadField_uploadtemplate.js +++ b/javascript/UploadField_uploadtemplate.js @@ -17,14 +17,14 @@ window.tmpl.cache['ss-uploadfield-uploadtemplate'] = tmpl( '{% if (!file.error) { %}' + '
' + '{% if (!o.options.autoUpload) { %}' + - '
' + + '
' + '{% } %}' + '{% } %}' + '
' + - '' + + '' + '
' + '
'+ - '' + + '' + '
' + '' + '' + diff --git a/templates/AssetUploadField.ss b/templates/AssetUploadField.ss index db2cdb6ed..a6485db72 100644 --- a/templates/AssetUploadField.ss +++ b/templates/AssetUploadField.ss @@ -47,7 +47,7 @@
- diff --git a/templates/Includes/HtmlEditorField_viewfile.ss b/templates/Includes/HtmlEditorField_viewfile.ss index 0e5f42590..c69b346db 100644 --- a/templates/Includes/HtmlEditorField_viewfile.ss +++ b/templates/Includes/HtmlEditorField_viewfile.ss @@ -23,12 +23,12 @@
-
- <% end_if %> - <% if $canDelete %> - + <% end_if %> <% if $UploadField.canAttachExisting %> - <% end_if %> diff --git a/templates/UploadField.ss b/templates/UploadField.ss index 12b43da96..7fb889a8f 100644 --- a/templates/UploadField.ss +++ b/templates/UploadField.ss @@ -57,11 +57,11 @@ <% end_if %> <% if $canAttachExisting %> - + <% end_if %> <% if $canUpload %> <% if not $autoUpload %> - + <% end_if %> <% end_if %>