Prevent enter button reloading page when focus is on meta-title in PSM

closes #5854

- adds an action that returns false on form submission
This commit is contained in:
cobbspur 2015-09-24 18:49:36 +01:00
parent 299a0534a6
commit 410116db48
2 changed files with 5 additions and 1 deletions

View File

@ -201,6 +201,10 @@ export default Ember.Controller.extend(SettingsMenuMixin, {
}, },
actions: { actions: {
discardEnter: function () {
return false;
},
togglePage: function () { togglePage: function () {
var self = this; var self = this;

View File

@ -105,7 +105,7 @@
</div> </div>
<div class="settings-menu-content"> <div class="settings-menu-content">
<form> <form {{action "discardEnter" on="submit"}}>
{{#gh-form-group errors=model.errors property="meta_title"}} {{#gh-form-group errors=model.errors property="meta_title"}}
<label for="meta-title">Meta Title</label> <label for="meta-title">Meta Title</label>
{{gh-input class="post-setting-meta-title" id="meta-title" value=metaTitleScratch name="post-setting-meta-title" focus-out="setMetaTitle" stopEnterKeyDownPropagation="true"}} {{gh-input class="post-setting-meta-title" id="meta-title" value=metaTitleScratch name="post-setting-meta-title" focus-out="setMetaTitle" stopEnterKeyDownPropagation="true"}}