Commit d54670e1c8cfaf78771ff981e98f1c230dcd99d2

Authored by Conrad Vermeulen
1 parent 709e5770

KTS-2456

"Dropdown in search bar and search portlet needs to be aligned correctly"
Fixed. Patched to work with IE

Committed By: Conrad Vermeulen
Reviewed By: Megan Watson


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7904 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 22 additions and 15 deletions
resources/js/search2widget.js
@@ -71,7 +71,7 @@ function populateSavedSearch(menu) @@ -71,7 +71,7 @@ function populateSavedSearch(menu)
71 { 71 {
72 return; 72 return;
73 } 73 }
74 - item = menu.addMenuItem({ 74 + var item = menu.addMenuItem({
75 text: sSearchTranslations[5], /*Saved Searches*/ 75 text: sSearchTranslations[5], /*Saved Searches*/
76 menu: { 76 menu: {
77 items: [] 77 items: []
@@ -95,15 +95,17 @@ function populateSavedSearch(menu) @@ -95,15 +95,17 @@ function populateSavedSearch(menu)
95 95
96 function createSearchBar(div, suffix) 96 function createSearchBar(div, suffix)
97 { 97 {
98 - x = Ext.get(div); 98 + var x = Ext.get(div);
99 if (x == null) 99 if (x == null)
100 { 100 {
101 return; 101 return;
102 } 102 }
103 103
  104 + var button;
  105 +
104 if (suffix == 1) 106 if (suffix == 1)
105 { 107 {
106 - menu = new Ext.menu.Menu({ 108 + var menu = new Ext.menu.Menu({
107 items: [ 109 items: [
108 { 110 {
109 text: sSearchTranslations[6], /* Advanced Search */ 111 text: sSearchTranslations[6], /* Advanced Search */
@@ -137,6 +139,7 @@ function createSearchBar(div, suffix) @@ -137,6 +139,7 @@ function createSearchBar(div, suffix)
137 ] 139 ]
138 }); 140 });
139 141
  142 +
140 button = new Ext.Toolbar.MenuButton({ 143 button = new Ext.Toolbar.MenuButton({
141 text: sSearchTranslations[11], /* search */ 144 text: sSearchTranslations[11], /* search */
142 handler: onSearchClick, 145 handler: onSearchClick,
@@ -145,50 +148,54 @@ function createSearchBar(div, suffix) @@ -145,50 +148,54 @@ function createSearchBar(div, suffix)
145 menu : menu 148 menu : menu
146 }); 149 });
147 150
  151 + populateSavedSearch(menu);
  152 +
  153 +
  154 +
148 155
149 } 156 }
150 else 157 else
151 { 158 {
152 menu = null; 159 menu = null;
153 - button = new Ext.Toolbar.Button({ 160 + button = new Ext.Toolbar.Button({
154 text: sSearchTranslations[11], /* search */ 161 text: sSearchTranslations[11], /* search */
155 pressed: true, 162 pressed: true,
156 handler: onSearchClick, 163 handler: onSearchClick,
157 - id: 'searchButton' + suffix, 164 + id: 'searchButton' + suffix
158 //cls: 'x-btn-text-icon blist', 165 //cls: 'x-btn-text-icon blist',
159 166
160 }); 167 });
161 } 168 }
162 169
163 var tb = new Ext.Toolbar(div); 170 var tb = new Ext.Toolbar(div);
164 - var el = Ext.get(div);  
165 171
166 - text_width = suffix==1?160:140;  
167 172
168 - txtField = new Ext.form.TextField({ 173 +
  174 + tb.add(new Ext.form.TextField({
169 emptyText: sSearchTranslations[12], /* Enter search criteria... */ 175 emptyText: sSearchTranslations[12], /* Enter search criteria... */
170 value: quickQuery, 176 value: quickQuery,
171 selectOnFocus:true, 177 selectOnFocus:true,
172 id:'txtSearchBar' + suffix, 178 id:'txtSearchBar' + suffix,
173 - width: text_width  
174 - });  
175 -  
176 - tb.add(txtField, '-',button); 179 + width: 110
  180 + }), button);
177 181
178 var map = new Ext.KeyMap("txtSearchBar" + suffix, 182 var map = new Ext.KeyMap("txtSearchBar" + suffix,
179 { 183 {
180 - key: 13, 184 + key: Ext.EventObject.ENTER,
181 fn: function() { 185 fn: function() {
182 onSearchClick(Ext.get('txtSearchBar' + suffix)); 186 onSearchClick(Ext.get('txtSearchBar' + suffix));
183 } 187 }
184 }); 188 });
185 189
  190 + var el = Ext.get(div);
186 if (suffix == 1) 191 if (suffix == 1)
187 { 192 {
188 - populateSavedSearch(menu);  
189 -  
190 el.applyStyles('position:relative; top: -3px'); 193 el.applyStyles('position:relative; top: -3px');
191 } 194 }
  195 + else
  196 + {
  197 + el.applyStyles('position:relative; left: 20px; top: 10px');
  198 + }
192 199
193 return menu; 200 return menu;
194 } 201 }