Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
o Fix search field placement in IE
Browse files Browse the repository at this point in the history
  • Loading branch information
nabcos committed Jul 11, 2012
1 parent e96d340 commit a1b19ac
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion nexus/nexus-webapp/src/main/webapp/js/extensions/SearchField.js
Expand Up @@ -10,11 +10,12 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
/*global Ext*/
Ext.app.SearchField = Ext.extend(Ext.form.TwinTriggerField, {
initComponent : function() {
Ext.app.SearchField.superclass.initComponent.call(this);
this.on('specialkey', function(f, e) {
if (e.getKey() == e.ENTER)
if (e.getKey() === e.ENTER)
{
this.onTrigger2Click();
}
Expand Down Expand Up @@ -55,6 +56,24 @@ Ext.app.SearchField = Ext.extend(Ext.form.TwinTriggerField, {
}
// var o = {start: 0};
this.searchPanel.startSearch(this.searchPanel, true);
},

/**
* Override TwinTriggerField#afterRender, because position calculation for IE was always off by 1 (or even many)
* pixels by default.
*/
afterRender : function(){
Ext.form.TriggerField.superclass.afterRender.call(this);
var y;
if (Ext.isIE && !this.hideTrigger) {
if (Ext.isIE8||Ext.isIE6) { // IE6 is also discovered for IE9
this.el.position();
this.el.setY(this.el.getY()+1);
} else if(Ext.isIE7 && this.el.getY() !== (y = this.trigger.getY())){
this.el.position();
this.el.setY(y);
}
}
}
});

Expand Down

0 comments on commit a1b19ac

Please sign in to comment.