Add missing updates in handlers.

This commit is contained in:
Hyunje Alex Jun 2015-01-30 23:37:22 +00:00
parent b000c771af
commit c8fe0b9269
2 changed files with 7 additions and 2 deletions

View File

@ -4,7 +4,8 @@
'use strict'; 'use strict';
var h = require('../../lib/helper') var h = require('../../lib/helper')
, instances = require('../instances'); , instances = require('../instances')
, updateGeometry = require('../update');
function bindClickRailHandler(element, i) { function bindClickRailHandler(element, i) {
function pageOffset(el) { function pageOffset(el) {
@ -26,6 +27,7 @@ function bindClickRailHandler(element, i) {
} }
element.scrollTop = (i.contentHeight - i.containerHeight) * positionRatio; element.scrollTop = (i.contentHeight - i.containerHeight) * positionRatio;
updateGeometry(element);
}); });
i.event.bind(i.scrollbarX, 'click', stopPropagation); i.event.bind(i.scrollbarX, 'click', stopPropagation);
@ -43,6 +45,7 @@ function bindClickRailHandler(element, i) {
} }
element.scrollLeft = (i.contentWidth - i.containerWidth) * positionRatio; element.scrollLeft = (i.contentWidth - i.containerWidth) * positionRatio;
updateGeometry(element);
}); });
} }

View File

@ -4,7 +4,8 @@
'use strict'; 'use strict';
var h = require('../../lib/helper') var h = require('../../lib/helper')
, instances = require('../instances'); , instances = require('../instances')
, updateGeometry = require('../update');
function bindKeyboardHandler(element, i) { function bindKeyboardHandler(element, i) {
var hovered = false; var hovered = false;
@ -100,6 +101,7 @@ function bindKeyboardHandler(element, i) {
element.scrollTop = element.scrollTop - deltaY; element.scrollTop = element.scrollTop - deltaY;
element.scrollLeft = element.scrollLeft + deltaX; element.scrollLeft = element.scrollLeft + deltaX;
updateGeometry(element);
shouldPrevent = shouldPreventDefault(deltaX, deltaY); shouldPrevent = shouldPreventDefault(deltaX, deltaY);
if (shouldPrevent) { if (shouldPrevent) {