Skip to content

Commit

Permalink
Pass in value to preventEnterSubmit directive
Browse files Browse the repository at this point in the history
  • Loading branch information
bjarnef committed Aug 17, 2020
1 parent 5d93d8e commit 7e02a94
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ angular.module("umbraco.directives")
}

$(element).on("keypress", function (event) {
if (event.which === 13) {
if (event.which === 13 && enabled === true) {
event.preventDefault();
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,14 @@
<div class="form-search form-search-filter">
<label for="{{vm.inputId}}" class="sr-only">{{vm.text}}</label>
<i class="icon-search" aria-hidden="true"></i>
<input
ng-if="vm.preventSubmitOnEnter"
id="{{vm.inputId}}"
type="text"
ng-change="vm.change()"
ng-model="vm.model"
class="umb-search-field search-query search-input input-block-level"
placeholder="{{vm.text}}"
umb-auto-focus="{{vm.autoFocus === true}}"
prevent-enter-submit
no-dirty-check />

<input
ng-if="!vm.preventSubmitOnEnter"
id="{{vm.inputId}}"
type="text"
ng-change="vm.change()"
ng-model="vm.model"
class="umb-search-field search-query search-input input-block-level"
placeholder="{{vm.text}}"
umb-auto-focus="{{vm.autoFocus === true}}"
no-dirty-check />
<input type="text"
id="{{vm.inputId}}"
ng-change="vm.change()"
ng-model="vm.model"
class="umb-search-field search-query search-input input-block-level"
placeholder="{{vm.text}}"
umb-auto-focus="{{vm.autoFocus === true}}"
prevent-enter-submit="vm.preventSubmitOnEnter"
no-dirty-check />
</div>
</div>

0 comments on commit 7e02a94

Please sign in to comment.