Fix NO_INTERFACE console error after itembox/tagsbox edit in Fx36

In Fx36+, QIing the scrollbox to nsIScrollBoxObject throws NO_INTERFACE,
presumably because https://bugzilla.mozilla.org/show_bug.cgi?id=364612
was implemented in some other ticket.
This commit is contained in:
Dan Stillman 2015-02-10 22:34:11 -05:00
parent aeada8032c
commit 62aa5acc0d
2 changed files with 7 additions and 4 deletions

View file

@ -1027,7 +1027,9 @@
<body> <body>
<![CDATA[ <![CDATA[
var sbo = document.getAnonymousNodes(this)[0].boxObject; var sbo = document.getAnonymousNodes(this)[0].boxObject;
sbo.QueryInterface(Components.interfaces.nsIScrollBoxObject); if (Zotero.platformMajorVersion < 36) {
sbo.QueryInterface(Components.interfaces.nsIScrollBoxObject);
}
sbo.ensureElementIsVisible(elem); sbo.ensureElementIsVisible(elem);
]]> ]]>
</body> </body>

View file

@ -1033,9 +1033,10 @@
<parameter name="elem"/> <parameter name="elem"/>
<body> <body>
<![CDATA[ <![CDATA[
var scrollbox = document.getAnonymousNodes(this)[0]; var sbo = document.getAnonymousNodes(this)[0].boxObject;
var sbo = scrollbox.boxObject; if (Zotero.platformMajorVersion < 36) {
sbo.QueryInterface(Components.interfaces.nsIScrollBoxObject); sbo.QueryInterface(Components.interfaces.nsIScrollBoxObject);
}
sbo.ensureElementIsVisible(elem); sbo.ensureElementIsVisible(elem);
]]> ]]>
</body> </body>