added scroll up and down events to receiveInteraction hat block

upd4.2
Bernat Romagosa 2018-01-22 16:00:10 +01:00
rodzic 7e74a345e5
commit 18750cc0d9
2 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -993,7 +993,9 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
'pressed' : ['pressed'],
'dropped' : ['dropped'],
'mouse-entered' : ['mouse-entered'],
'mouse-departed' : ['mouse-departed']
'mouse-departed' : ['mouse-departed'],
'scrolled-up' : ['scrolled-up'],
'scrolled-down' : ['scrolled-down']
},
true // read-only
);

Wyświetl plik

@ -4827,6 +4827,10 @@ SpriteMorph.prototype.mouseDownLeft = function () {
return this.receiveUserInteraction('pressed');
};
SpriteMorph.prototype.mouseScroll = function (y) {
return this.receiveUserInteraction('scrolled-' + (y > 0 ? 'up' : 'down'));
};
SpriteMorph.prototype.receiveUserInteraction = function (interaction) {
var stage = this.parentThatIsA(StageMorph),
procs = [],