Bug 343097 - Cleaner arrowscrollbox-clicktoscroll binding. r=sspitzer/mconnor.

This commit is contained in:
mozilla.mano@sent.com 2007-08-21 22:01:29 -07:00
Родитель ae404b15fe
Коммит 174b585bad
1 изменённых файлов: 12 добавлений и 9 удалений

Просмотреть файл

@ -1607,21 +1607,24 @@
<body>
<![CDATA[
if (aDragSession.canDrop && aDragSession.sourceNode) {
// autoscroll the tab strip if we drag over the autorepeat
var tabStrip = this.mTabContainer.mTabstrip;
// autoscroll the tab strip if we drag over the scroll
// buttons, even if we aren't dragging a tab, but then
// return to avoid drawing the drop indicator
var isTabDrag = (aDragSession.sourceNode.parentNode == this.mTabContainer);
var pixelsToScroll = 0;
var tabStrip = this.mTabContainer.mTabstrip;
if (aEvent.originalTarget.localName == "autorepeatbutton") {
if (aEvent.originalTarget.getAttribute("class") ==
"autorepeatbutton-up")
var targetAnonid = aEvent.originalTarget.getAttribute("anonid");
if (targetAnonid == "scrollbutton-up") {
pixelsToScroll = tabStrip.scrollIncrement * -1;
else
tabStrip.scrollByPixels(pixelsToScroll);
}
else if (targetAnonid == "scrollbutton-down") {
pixelsToScroll = tabStrip.scrollIncrement;
tabStrip.scrollByPixels(pixelsToScroll);
}
var isTabDrag = (aDragSession.sourceNode.parentNode == this.mTabContainer);
if (!isTabDrag)
return;