Fix for U4-3831. Removes form, adds ng-click with $event.preventDefault() to prevent premature saving.
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user