on master help sign in
Get rid of isClicked

It can be argued that everything should be derived from isDown and position (the two real facts about the mouse), so maybe that is a direction to go from here.

commit007ea7126f55e5355298c09d44be6dad223cdce8 authorEvan Czaplicki <info@elm-lang.org> dateMon 27 Jan 2014, 12:29 (13 years ago) parent50c2618
2 files changed+3−12
libraries/Mouse.elm+1−6 libraries/Native/Signal/Mouse.js+2−6
libraries/Mouse.elm+1−6
@@ -7,7 +7,7 @@ module Mouse where
77@docs position, x, y
88
99# Button Status
10−@docs isDown, clicks, isClicked
10+@docs isDown, clicks
1111
1212-}
1313
@@ -31,11 +31,6 @@ True when the button is down, and false otherwise. -}
3131isDown : Signal Bool
3232isDown = Native.Mouse.isDown
3333
34−{-| True immediately after the left mouse-button has been clicked,
35−and false otherwise. -}
36−isClicked : Signal Bool
37−isClicked = Native.Mouse.isClicked
38−
3934{-| Always equal to unit. Event triggers on every mouse click. -}
4035clicks : Signal ()
4136clicks = Native.Mouse.clicks
libraries/Native/Signal/Mouse.js+2−6
@@ -20,15 +20,12 @@ Elm.Native.Mouse.make = function(elm) {
2020 y.defaultNumberOfKids = 0;
2121
2222 var isDown = Signal.constant(false);
23− var isClicked = Signal.constant(false);
2423 var clicks = Signal.constant(Utils.Tuple0);
2524
2625 var node = elm.display === ElmRuntime.Display.FULLSCREEN ? document : elm.node;
2726
28− elm.addListener([isClicked.id, clicks.id], node, 'click', function click() {
29− elm.notify(isClicked.id, true);
27+ elm.addListener([clicks.id], node, 'click', function click() {
3028 elm.notify(clicks.id, Utils.Tuple0);
31− elm.notify(isClicked.id, false);
3229 });
3330 elm.addListener([isDown.id], node, 'mousedown', function down() {
3431 elm.notify(isDown.id, true);
@@ -44,8 +41,7 @@ Elm.Native.Mouse.make = function(elm) {
4441 position: position,
4542 x:x,
4643 y:y,
47− isClicked: isClicked,
4844 isDown: isDown,
4945 clicks: clicks
5046 };
51−};
47+};