Index: trunk/phase3/skins/common/mwsuggest.js |
— | — | @@ -78,6 +78,7 @@ |
79 | 79 | this.containerRow = 0; // height of result field in the container |
80 | 80 | this.containerTotal = 0; // total height of the container will all results |
81 | 81 | this.visible = false; // if container is visible |
| 82 | + this.stayHidden = false; // don't try to show if lost focus |
82 | 83 | } |
83 | 84 | |
84 | 85 | /** Hide results div */ |
— | — | @@ -93,6 +94,8 @@ |
94 | 95 | function os_showResults(r){ |
95 | 96 | if(os_is_stopped) |
96 | 97 | return; |
| 98 | + if(r.stayHidden) |
| 99 | + return |
97 | 100 | os_fitContainer(r); |
98 | 101 | var c = document.getElementById(r.container); |
99 | 102 | r.selected = -1; |
— | — | @@ -442,6 +445,7 @@ |
443 | 446 | /** Init timed update via os_delayedUpdate() */ |
444 | 447 | function os_fetchResults(r, query, timeout){ |
445 | 448 | if(query == ""){ |
| 449 | + r.query = ""; |
446 | 450 | os_hideResults(r); |
447 | 451 | return; |
448 | 452 | } else if(query == r.query) |
— | — | @@ -622,13 +626,19 @@ |
623 | 627 | var r = os_map[targ.id]; |
624 | 628 | if(r == null) |
625 | 629 | return; // not our event |
626 | | - if(!os_mouse_pressed) |
| 630 | + if(!os_mouse_pressed){ |
627 | 631 | os_hideResults(r); |
| 632 | + r.stayHidden = true |
| 633 | + } |
628 | 634 | } |
629 | 635 | |
630 | 636 | /** Event: focus (catch only when stopped) */ |
631 | 637 | function os_eventFocus(e){ |
632 | | - // nothing happens here? |
| 638 | + var targ = os_getTarget(e); |
| 639 | + var r = os_map[targ.id]; |
| 640 | + if(r == null) |
| 641 | + return; // not our event |
| 642 | + r.stayHidden = false |
633 | 643 | } |
634 | 644 | |
635 | 645 | |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1477,7 +1477,7 @@ |
1478 | 1478 | * to ensure that client-side caches don't keep obsolete copies of global |
1479 | 1479 | * styles. |
1480 | 1480 | */ |
1481 | | -$wgStyleVersion = '217'; |
| 1481 | +$wgStyleVersion = '218'; |
1482 | 1482 | |
1483 | 1483 | |
1484 | 1484 | # Server-side caching: |