Preventing rogue modals from popping up when hitting the enter-key

closes #3352
- adding a ```type``` attribute to buttons inside form in the settings section
- scanning the rest of the project to find any other buttons w/a missing attribute
This commit is contained in:
Maurice Williams 2014-07-21 23:27:28 -04:00 committed by Maurice Williams
parent 4968336b0f
commit 835bf0bd07
9 changed files with 16 additions and 16 deletions

View File

@ -1,6 +1,6 @@
<header class="floatingheader">
<button class="button-back" href="#">Back</button>
<button {{bind-attr class="featured:featured:unfeatured"}} title="Feature this post" {{action "toggleFeatured"}}>
<button type="button" class="button-back" href="#">Back</button>
<button type="button" {{bind-attr class="featured:featured:unfeatured"}} title="Feature this post" {{action "toggleFeatured"}}>
<span class="hidden">Star</span>
</button>
<small>

View File

@ -8,10 +8,10 @@
</section>
{{#if confirm}}
<footer class="modal-footer">
<button {{bind-attr class="acceptButtonClass :js-button-accept"}} {{action "confirm" "accept"}}>
<button type="button" {{bind-attr class="acceptButtonClass :js-button-accept"}} {{action "confirm" "accept"}}>
{{confirm.accept.text}}
</button>
<button {{bind-attr class="rejectButtonClass :js-button-reject"}} {{action "confirm" "reject"}}>
<button type="button" {{bind-attr class="rejectButtonClass :js-button-reject"}} {{action "confirm" "reject"}}>
{{confirm.reject.text}}
</button>
</footer>

View File

@ -44,4 +44,4 @@
</tbody>
</table>
</form>
<button class="delete" {{action "openModal" "delete-post" this}}>Delete This Post</button>
<button type="button" class="delete" {{action "openModal" "delete-post" this}}>Delete This Post</button>

View File

@ -1,6 +1,6 @@
<div class="no-posts-box">
<div class="no-posts">
<h3>You Haven't Written Any Posts Yet!</h3>
{{#link-to "editor.new"}}<button class="button-add large" title="New Post">Write a new Post</button>{{/link-to}}
{{#link-to "editor.new"}}<button type="button" class="button-add large" title="New Post">Write a new Post</button>{{/link-to}}
</div>
</div>

View File

@ -16,7 +16,7 @@
{{#if package}}{{package.name}} - {{package.version}}{{else}}{{name}} - package.json missing :({{/if}}
</td>
<td>
<button {{action toggleApp this}} {{bind-attr class=":js-button-active activeClass:button-delete inactiveClass:button-add activeClass:js-button-deactivate"}}>
<button type="button" {{action toggleApp this}} {{bind-attr class=":js-button-active activeClass:button-delete inactiveClass:button-add activeClass:js-button-deactivate"}}>
{{buttonText}}
</button>
</td>

View File

@ -5,7 +5,7 @@
{{#link-to 'settings' class='button-back button'}}Back{{/link-to}}
<section class="page-actions">
<button class="button-save" {{action "save"}}>Save</button>
<button type="button" class="button-save" {{action "save"}}>Save</button>
</section>
</div>
</header>
@ -33,9 +33,9 @@
<div class="form-group">
<label for="blog-logo">Blog Logo</label>
{{#if logo}}
<button class="js-modal-logo" {{action "openModal" "upload" this "logo"}}><img id="blog-logo" {{bind-attr src=logo}} alt="logo"></button>
<button type="button" class="js-modal-logo" {{action "openModal" "upload" this "logo"}}><img id="blog-logo" {{bind-attr src=logo}} alt="logo"></button>
{{else}}
<button class="button-add js-modal-logo" {{action "openModal" "upload" this "logo"}}>Upload Image</button>
<button type="button" class="button-add js-modal-logo" {{action "openModal" "upload" this "logo"}}>Upload Image</button>
{{/if}}
<p>Display a sexy logo for your publication</p>
</div>
@ -43,9 +43,9 @@
<div class="form-group">
<label for="blog-cover">Blog Cover</label>
{{#if cover}}
<button class="js-modal-cover" {{action "openModal" "upload" this "cover"}}><img id="blog-cover" {{bind-attr src=cover}} alt="cover photo"></button>
<button type="button" class="js-modal-cover" {{action "openModal" "upload" this "cover"}}><img id="blog-cover" {{bind-attr src=cover}} alt="cover photo"></button>
{{else}}
<button class="button-add js-modal-cover" {{action "openModal" "upload" this "cover"}}>Upload Image</button>
<button type="button" class="button-add js-modal-cover" {{action "openModal" "upload" this "cover"}}>Upload Image</button>
{{/if}}
<p>Display a cover image on your site</p>
</div>

View File

@ -28,7 +28,7 @@
<header class="user-profile-header">
<img id="user-cover" class="cover-image" {{bind-attr src=cover title=coverTitle}} />
<button class="edit-cover-image js-modal-cover button" {{action "openModal" "upload" user "cover"}}>Change Cover</button>
<button type="button" class="edit-cover-image js-modal-cover button" {{action "openModal" "upload" user "cover"}}>Change Cover</button>
</header>
<form class="user-profile" novalidate="novalidate" autocomplete="off">
@ -37,7 +37,7 @@
<figure class="user-image">
<div id="user-image" class="img" {{bind-attr style=image}} href="#"><span class="hidden">{{name}}"s Picture</span></div>
<button {{action "openModal" "upload" user "image"}} class="edit-user-image js-modal-image">Edit Picture</button>
<button type="button" {{action "openModal" "upload" user "image"}} class="edit-user-image js-modal-image">Edit Picture</button>
</figure>
<div class="form-group">

View File

@ -26,7 +26,7 @@
<p>Must be at least 8 characters</p>
</div>
<footer>
<button class="button-add large" {{action "setup"}} {{bind-attr disabled=submitting}}>Ok, Let's Do This</button>
<button type="submit" class="button-add large" {{action "setup"}} {{bind-attr disabled=submitting}}>Ok, Let's Do This</button>
</footer>
</form>
</div>

View File

@ -21,7 +21,7 @@
<p>Must be at least 8 characters</p>
</div>
<footer>
<button class="button-add large" {{action "signup"}} {{bind-attr disabled=submitting}}>Create Account</button>
<button type="submit" class="button-add large" {{action "signup"}} {{bind-attr disabled=submitting}}>Create Account</button>
</footer>
</form>
</div>