FIX (partial) for #1288 where non-submit buttons are being activated on "enter" key press (relates to framework issue at https://github.com/silverstripe/silverstripe-framework/issues/3181).

This commit is contained in:
Patrick Nelson 2015-10-05 11:22:36 -04:00
parent f7985b34f2
commit 332e490147
3 changed files with 5 additions and 4 deletions

View File

@ -122,6 +122,7 @@
updateURLFromTitle = $('<button />', {
'class': 'update ss-ui-button-small',
'text': ss.i18n._t('URLSEGMENT.UpdateURL'),
'type': 'button',
'click': function(e) {
e.preventDefault();
self.updateURLSegment(self.val());

View File

@ -3,7 +3,7 @@
<a class="ss-ui-button cms-content-addpage-button tool-button font-icon-plus" href="$LinkPageAdd" data-url-addpage="{$LinkPageAdd('', 'ParentID=%s')}"><% _t('CMSMain.AddNewButton', 'Add new') %></a>
<% if $View == 'Tree' %>
<button class="cms-content-batchactions-button tool-button font-icon-check-mark-2" data-toolid="batch-actions">
<button type="button" class="cms-content-batchactions-button tool-button font-icon-check-mark-2" data-toolid="batch-actions">
<% _t("CMSPagesController_ContentToolbar_ss.MULTISELECT","Batch actions") %>
</button>
<% end_if %>

View File

@ -2,16 +2,16 @@
<a class="preview" href="$URL" target="_blank">
$URL
</a>
<button class="ss-ui-button ss-ui-button-small edit">
<button type="button" class="ss-ui-button ss-ui-button-small edit">
<% _t('URLSegmentField.Edit', 'Edit') %>
</button>
</div>
<div class="edit-holder">
<input $AttributesHTML />
<button class="update ss-ui-button-small">
<button type="button" class="update ss-ui-button-small">
<% _t('URLSegmentField.OK', 'OK') %>
</button>
<button class="cancel ss-ui-button-small ss-ui-action-minor">
<button type="button" class="cancel ss-ui-button-small ss-ui-action-minor">
<% _t('URLSegmentField.Cancel', 'Cancel') %>
</button>
<% if $HelpText %><p class="help">$HelpText</p><% end_if %>