Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add types to buttons to prevent Angular form submission on Enter keypress #35

Open
wants to merge 1 commit into
base: v11/main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions source/SimpleRedirects.Site/App_Plugins/SimpleRedirects/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ <h1>

<!-- Delete All Redirects -->
<div class="pull-right">
<button class="btn btn-danger btn-sm" ng-click="deleteAllRedirects()">Delete All</button>
<button type="button" class="btn btn-danger btn-sm" ng-click="deleteAllRedirects()">Delete All</button>
</div>

<!-- Clear Cache -->
<div class="pull-right padding-right">
<span ng-show="cacheCleared">Cache Cleared!</span>
<button class="btn btn-info btn-sm" ng-click="clearCache()">Clear Cache</button>
<button type="button" class="btn btn-info btn-sm" ng-click="clearCache()">Clear Cache</button>
</div>

<!-- Export Redirects -->
<div class="pull-right padding-right">
<button class="btn btn-info btn-sm" ng-click="openExportOverlay()">Export Redirects</button>
<button type="button" class="btn btn-info btn-sm" ng-click="openExportOverlay()">Export Redirects</button>
</div>

<!-- Import Redirects -->
<div class="pull-right padding-right">
<button class="btn btn-info btn-sm" ng-click="openImportOverlay()">Import Redirects</button>
<button type="button" class="btn btn-info btn-sm" ng-click="openImportOverlay()">Import Redirects</button>
</div>

<p class="lead">
Expand Down Expand Up @@ -93,10 +93,10 @@ <h3 class="table-title p-20"> {{redirects.length}} rows</h3>
{{ item.lastUpdated | date:'M/d/yy h:mm a' }}
</td>
<td data-title="'Actions'">
<button ng-if="!item.$edit" ng-click="item.$edit = true" class="btn btn-info">Edit</button>
<button ng-if="item.$edit && item.id != -1" ng-click="updateRedirect(item)" class="btn btn-success">Save</button>
<button ng-if="item.id != -1" class="btn btn-danger" ng-click="deleteRedirect(item)">Delete</button>
<button ng-if="item.$edit && item.id == -1" ng-click="addRedirect(item)" class="btn btn-primary">Add</button>
<button type="button" ng-if="!item.$edit" ng-click="item.$edit = true" class="btn btn-info">Edit</button>
<button type="button" ng-if="item.$edit && item.id != -1" ng-click="updateRedirect(item)" class="btn btn-success">Save</button>
<button type="button" ng-if="item.id != -1" class="btn btn-danger" ng-click="deleteRedirect(item)">Delete</button>
<button type="button" ng-if="item.$edit && item.id == -1" ng-click="addRedirect(item)" class="btn btn-primary">Add</button>
</td>
</tr>
</tbody>
Expand Down
16 changes: 8 additions & 8 deletions source/SimpleRedirects/App_Plugins/SimpleRedirects/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ <h1>

<!-- Delete All Redirects -->
<div class="pull-right">
<button class="btn btn-danger btn-sm" ng-click="deleteAllRedirects()">Delete All</button>
<button type="button" class="btn btn-danger btn-sm" ng-click="deleteAllRedirects()">Delete All</button>
</div>

<!-- Clear Cache -->
<div class="pull-right padding-right">
<span ng-show="cacheCleared">Cache Cleared!</span>
<button class="btn btn-info btn-sm" ng-click="clearCache()">Clear Cache</button>
<button type="button" class="btn btn-info btn-sm" ng-click="clearCache()">Clear Cache</button>
</div>

<!-- Export Redirects -->
<div class="pull-right padding-right">
<button class="btn btn-info btn-sm" ng-click="openExportOverlay()">Export Redirects</button>
<button type="button" class="btn btn-info btn-sm" ng-click="openExportOverlay()">Export Redirects</button>
</div>

<!-- Import Redirects -->
<div class="pull-right padding-right">
<button class="btn btn-info btn-sm" ng-click="openImportOverlay()">Import Redirects</button>
<button type="button" class="btn btn-info btn-sm" ng-click="openImportOverlay()">Import Redirects</button>
</div>

<p class="lead">
Expand Down Expand Up @@ -93,10 +93,10 @@ <h3 class="table-title p-20"> {{redirects.length}} rows</h3>
{{ item.lastUpdated | date:'M/d/yy h:mm a' }}
</td>
<td data-title="'Actions'">
<button ng-if="!item.$edit" ng-click="item.$edit = true" class="btn btn-info">Edit</button>
<button ng-if="item.$edit && item.id != -1" ng-click="updateRedirect(item)" class="btn btn-success">Save</button>
<button ng-if="item.id != -1" class="btn btn-danger" ng-click="deleteRedirect(item)">Delete</button>
<button ng-if="item.$edit && item.id == -1" ng-click="addRedirect(item)" class="btn btn-primary">Add</button>
<button type="button" ng-if="!item.$edit" ng-click="item.$edit = true" class="btn btn-info">Edit</button>
<button type="button" ng-if="item.$edit && item.id != -1" ng-click="updateRedirect(item)" class="btn btn-success">Save</button>
<button type="button" ng-if="item.id != -1" class="btn btn-danger" ng-click="deleteRedirect(item)">Delete</button>
<button type="button" ng-if="item.$edit && item.id == -1" ng-click="addRedirect(item)" class="btn btn-primary">Add</button>
</td>
</tr>
</tbody>
Expand Down