ItEr22S12CUVistaRecursosTempoPorProxectoItEr21S07: Synchronizing the zoom buttons with the scroll too.
This commit is contained in:
parent
61d2be74c0
commit
de1ad134b9
2 changed files with 20 additions and 0 deletions
|
|
@ -31,6 +31,19 @@ function ScrollSync(element){
|
|||
var target = toFunction(synched);
|
||||
yChanges.push(function(){ target().scrollTop = element.scrollTop; });
|
||||
};
|
||||
|
||||
this.notifyXChangeTo = function(listenerReceivingScroll){
|
||||
xChanges.push(function(){
|
||||
listenerReceivingScroll(element.scrollLeft);
|
||||
});
|
||||
};
|
||||
|
||||
this.notifyYChangeTo = function(listenerReceivingScroll){
|
||||
yChanges.push(function() {
|
||||
listenerReceivingScroll(element.scrollTop);
|
||||
});
|
||||
};
|
||||
|
||||
YAHOO.util.Event.addListener(element,'scroll', notifyListeners);
|
||||
return this;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,11 +13,18 @@ function addResourcesLoadListMethods(object) {
|
|||
return document.getElementById('timetracker');
|
||||
}
|
||||
|
||||
function zoom_buttons() {
|
||||
return document.getElementById('zoom_buttons');
|
||||
}
|
||||
|
||||
object.init = function(cmp) {
|
||||
this.adjustTimeTrackerSize(cmp);
|
||||
YAHOO.util.Event.addListener(window, 'resize',
|
||||
zkResourcesLoadList.adjustTimeTrackerSize, cmp);
|
||||
scrollSync = new ScrollSync(cmp);
|
||||
scrollSync.notifyXChangeTo(function(scroll) {
|
||||
zoom_buttons().style["left"] = scroll+"px";
|
||||
});
|
||||
scrollSync.synchXChangeTo(timetracker);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue