Fix for U4-3831. Removes form, adds ng-click with $event.preventDefault() to prevent premature saving.

This commit is contained in:
Bob Davidson
2014-01-14 15:40:22 -06:00
parent 0aa72e5026
commit 0da7ed8d93
2 changed files with 3 additions and 4 deletions

View File

@@ -43,7 +43,7 @@
$scope.model.value.splice(idx, 1);
};
$scope.add = function () {
$scope.add = function ($event) {
if ($scope.newCaption == "") {
$scope.hasError = true;
} else {
@@ -79,6 +79,7 @@
$scope.newInternalName = '';
}
$event.preventDefault();
};
$scope.switch = function ($event) {

View File

@@ -51,7 +51,6 @@
</td>
</tr>
<tr>
<form ng-submit="add()">
<td><input type="text" ng-model="newCaption" placeholder="Enter a new caption" val-highlight="hasError"/></td>
<td>
<div ng-show="addExternal">
@@ -68,10 +67,9 @@
<td><input type="checkbox" ng-model="newNewWindow"/> </td>
<td>
<div class="btn-group">
<input type="submit" class="btn btn-default" value="Add"/>
<button class="btn btn-default" ng-click="add($event)">Add</button>
</div>
</td>
</form>
</tr>
</tbody>
</table>