kopia lustrzana https://github.com/backface/turtlestitch
Merge pull request #1997 from bromagosa/scroll-events
Add scroll events to receiveInteraction hat morphupd4.2
commit
d8b6b5df37
|
@ -993,7 +993,9 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
|
||||||
'pressed' : ['pressed'],
|
'pressed' : ['pressed'],
|
||||||
'dropped' : ['dropped'],
|
'dropped' : ['dropped'],
|
||||||
'mouse-entered' : ['mouse-entered'],
|
'mouse-entered' : ['mouse-entered'],
|
||||||
'mouse-departed' : ['mouse-departed']
|
'mouse-departed' : ['mouse-departed'],
|
||||||
|
'scrolled-up' : ['scrolled-up'],
|
||||||
|
'scrolled-down' : ['scrolled-down']
|
||||||
},
|
},
|
||||||
true // read-only
|
true // read-only
|
||||||
);
|
);
|
||||||
|
|
|
@ -4827,6 +4827,10 @@ SpriteMorph.prototype.mouseDownLeft = function () {
|
||||||
return this.receiveUserInteraction('pressed');
|
return this.receiveUserInteraction('pressed');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
SpriteMorph.prototype.mouseScroll = function (y) {
|
||||||
|
return this.receiveUserInteraction('scrolled-' + (y > 0 ? 'up' : 'down'));
|
||||||
|
};
|
||||||
|
|
||||||
SpriteMorph.prototype.receiveUserInteraction = function (interaction) {
|
SpriteMorph.prototype.receiveUserInteraction = function (interaction) {
|
||||||
var stage = this.parentThatIsA(StageMorph),
|
var stage = this.parentThatIsA(StageMorph),
|
||||||
procs = [],
|
procs = [],
|
||||||
|
@ -7685,6 +7689,9 @@ StageMorph.prototype.mouseLeave = function () {
|
||||||
StageMorph.prototype.mouseDownLeft
|
StageMorph.prototype.mouseDownLeft
|
||||||
= SpriteMorph.prototype.mouseDownLeft;
|
= SpriteMorph.prototype.mouseDownLeft;
|
||||||
|
|
||||||
|
StageMorph.prototype.mouseScroll
|
||||||
|
= SpriteMorph.prototype.mouseScroll;
|
||||||
|
|
||||||
StageMorph.prototype.receiveUserInteraction
|
StageMorph.prototype.receiveUserInteraction
|
||||||
= SpriteMorph.prototype.receiveUserInteraction;
|
= SpriteMorph.prototype.receiveUserInteraction;
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue