Fixes tags property editor to not submit the html form when pressing enter.
This commit is contained in:
@@ -11,6 +11,10 @@ angular.module("umbraco")
|
||||
$scope.addTag = function(e) {
|
||||
var code = e.keyCode || e.which;
|
||||
if (code == 13) { //Enter keycode
|
||||
|
||||
//this is required, otherwise the html form will attempt to submit.
|
||||
e.preventDefault();
|
||||
|
||||
if ($scope.currentTags.indexOf($scope.tagToAdd) < 0) {
|
||||
$scope.currentTags.push($scope.tagToAdd);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<span ng-repeat="tag in currentTags" ng-click="removeTag(tag)" class="label label-primary tag">{{tag}} <i class="icon icon-delete"></i></span>
|
||||
|
||||
<input type="text"
|
||||
ng-keyup="addTag($event)"
|
||||
ng-keydown="addTag($event)"
|
||||
placeholder="Type to add tags.."
|
||||
ng-model="tagToAdd" />
|
||||
</div>
|
||||
Reference in New Issue
Block a user