Add button type to et2_buttons in order to stop default browser submit behavior

-Fix addressbook and tracker nm search opens new popup
This commit is contained in:
Hadi Nategh 2015-02-04 17:31:23 +00:00
parent c896dfdcee
commit ec5ef7c1c8
2 changed files with 3 additions and 1 deletions

View File

@ -2085,6 +2085,7 @@ var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader,
.on("keypress", function(event) { .on("keypress", function(event) {
if(event.which == 13) if(event.which == 13)
{ {
event.preventDefault();
self.getInstanceManager().autocomplete_fixer(); self.getInstanceManager().autocomplete_fixer();
self.nextmatch.applyFilters({search: self.search.getValue()}); self.nextmatch.applyFilters({search: self.search.getValue()});
} }

View File

@ -99,7 +99,8 @@ var et2_button = et2_baseWidget.extend([et2_IInput, et2_IDetachedDOM],
if (!this.options.readonly) if (!this.options.readonly)
{ {
this.btn = $j(document.createElement("button")) this.btn = $j(document.createElement("button"))
.addClass("et2_button et2_button_text"); .addClass("et2_button et2_button_text")
.attr({type:"button"});
this.setDOMNode(this.btn[0]); this.setDOMNode(this.btn[0]);
} }
}, },