зеркало из https://github.com/mozilla/pjs.git
Bug 708071 - Make the spell checking UI not hold on to a document in memory when spelling suggestion is invoked through the context menu. r=gavin
This commit is contained in:
Родитель
e6afd9509c
Коммит
161a558a6e
|
@ -279,7 +279,11 @@
|
|||
if (gContextMenu.shouldDisplay)
|
||||
updateEditUIVisibility();
|
||||
return gContextMenu.shouldDisplay;"
|
||||
onpopuphiding="if (event.target == this) { gContextMenu = null; updateEditUIVisibility(); }">
|
||||
onpopuphiding="if (event.target != this)
|
||||
return;
|
||||
gContextMenu.hiding();
|
||||
gContextMenu = null;
|
||||
updateEditUIVisibility();">
|
||||
#include browser-context.inc
|
||||
</menupopup>
|
||||
|
||||
|
|
|
@ -97,6 +97,12 @@ nsContextMenu.prototype = {
|
|||
this.initItems();
|
||||
},
|
||||
|
||||
hiding: function CM_hiding() {
|
||||
InlineSpellCheckerUI.clearSuggestionsFromMenu();
|
||||
InlineSpellCheckerUI.clearDictionaryListFromMenu();
|
||||
InlineSpellCheckerUI.uninit();
|
||||
},
|
||||
|
||||
initItems: function CM_initItems() {
|
||||
this.initPageMenuSeparator();
|
||||
this.initOpenItems();
|
||||
|
@ -488,16 +494,6 @@ nsContextMenu.prototype = {
|
|||
this.onEditableArea = false;
|
||||
this.isDesignMode = false;
|
||||
|
||||
// Clear any old spellchecking items from the menu, this used to
|
||||
// be in the menu hiding code but wasn't getting called in all
|
||||
// situations. Here, we can ensure it gets cleaned up any time the
|
||||
// menu is shown. Note: must be before uninit because that clears the
|
||||
// internal vars
|
||||
InlineSpellCheckerUI.clearSuggestionsFromMenu();
|
||||
InlineSpellCheckerUI.clearDictionaryListFromMenu();
|
||||
|
||||
InlineSpellCheckerUI.uninit();
|
||||
|
||||
// Remember the node that was clicked.
|
||||
this.target = aNode;
|
||||
|
||||
|
|
|
@ -87,8 +87,10 @@
|
|||
if (gContextMenu.shouldDisplay)
|
||||
document.popupNode = this.triggerNode;
|
||||
return gContextMenu.shouldDisplay;"
|
||||
onpopuphiding="if (event.target == this)
|
||||
gContextMenu = null;">
|
||||
onpopuphiding="if (event.target != this)
|
||||
return;
|
||||
gContextMenu.hiding();
|
||||
gContextMenu = null;">
|
||||
#include browser-context.inc
|
||||
</menupopup>
|
||||
</popupset>
|
||||
|
|
|
@ -69,6 +69,7 @@ InlineSpellChecker.prototype = {
|
|||
this.mDictionaryMenu = null;
|
||||
this.mDictionaryNames = [];
|
||||
this.mDictionaryItems = [];
|
||||
this.mWordNode = null;
|
||||
},
|
||||
|
||||
// for each UI event, you must call this function, it will compute the
|
||||
|
|
Загрузка…
Ссылка в новой задаче