Commit 3bd9008a3fa63f6c2dde8f95a7bd41a7f19c77b2
1 parent
051d9203
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 | 71 | { |
| 72 | 72 | return; |
| 73 | 73 | } |
| 74 | - item = menu.addMenuItem({ | |
| 74 | + var item = menu.addMenuItem({ | |
| 75 | 75 | text: sSearchTranslations[5], /*Saved Searches*/ |
| 76 | 76 | menu: { |
| 77 | 77 | items: [] |
| ... | ... | @@ -95,15 +95,17 @@ function populateSavedSearch(menu) |
| 95 | 95 | |
| 96 | 96 | function createSearchBar(div, suffix) |
| 97 | 97 | { |
| 98 | - x = Ext.get(div); | |
| 98 | + var x = Ext.get(div); | |
| 99 | 99 | if (x == null) |
| 100 | 100 | { |
| 101 | 101 | return; |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | + var button; | |
| 105 | + | |
| 104 | 106 | if (suffix == 1) |
| 105 | 107 | { |
| 106 | - menu = new Ext.menu.Menu({ | |
| 108 | + var menu = new Ext.menu.Menu({ | |
| 107 | 109 | items: [ |
| 108 | 110 | { |
| 109 | 111 | text: sSearchTranslations[6], /* Advanced Search */ |
| ... | ... | @@ -137,6 +139,7 @@ function createSearchBar(div, suffix) |
| 137 | 139 | ] |
| 138 | 140 | }); |
| 139 | 141 | |
| 142 | + | |
| 140 | 143 | button = new Ext.Toolbar.MenuButton({ |
| 141 | 144 | text: sSearchTranslations[11], /* search */ |
| 142 | 145 | handler: onSearchClick, |
| ... | ... | @@ -145,50 +148,54 @@ function createSearchBar(div, suffix) |
| 145 | 148 | menu : menu |
| 146 | 149 | }); |
| 147 | 150 | |
| 151 | + populateSavedSearch(menu); | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 148 | 155 | |
| 149 | 156 | } |
| 150 | 157 | else |
| 151 | 158 | { |
| 152 | 159 | menu = null; |
| 153 | - button = new Ext.Toolbar.Button({ | |
| 160 | + button = new Ext.Toolbar.Button({ | |
| 154 | 161 | text: sSearchTranslations[11], /* search */ |
| 155 | 162 | pressed: true, |
| 156 | 163 | handler: onSearchClick, |
| 157 | - id: 'searchButton' + suffix, | |
| 164 | + id: 'searchButton' + suffix | |
| 158 | 165 | //cls: 'x-btn-text-icon blist', |
| 159 | 166 | |
| 160 | 167 | }); |
| 161 | 168 | } |
| 162 | 169 | |
| 163 | 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 | 175 | emptyText: sSearchTranslations[12], /* Enter search criteria... */ |
| 170 | 176 | value: quickQuery, |
| 171 | 177 | selectOnFocus:true, |
| 172 | 178 | id:'txtSearchBar' + suffix, |
| 173 | - width: text_width | |
| 174 | - }); | |
| 175 | - | |
| 176 | - tb.add(txtField, '-',button); | |
| 179 | + width: 110 | |
| 180 | + }), button); | |
| 177 | 181 | |
| 178 | 182 | var map = new Ext.KeyMap("txtSearchBar" + suffix, |
| 179 | 183 | { |
| 180 | - key: 13, | |
| 184 | + key: Ext.EventObject.ENTER, | |
| 181 | 185 | fn: function() { |
| 182 | 186 | onSearchClick(Ext.get('txtSearchBar' + suffix)); |
| 183 | 187 | } |
| 184 | 188 | }); |
| 185 | 189 | |
| 190 | + var el = Ext.get(div); | |
| 186 | 191 | if (suffix == 1) |
| 187 | 192 | { |
| 188 | - populateSavedSearch(menu); | |
| 189 | - | |
| 190 | 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 | 200 | return menu; |
| 194 | 201 | } | ... | ... |