Skip to content

Commit 280e4d9

Browse files
committed
Reordered parameters to match conventional object-last ordering
1 parent 2418907 commit 280e4d9

File tree

6 files changed

+44
-44
lines changed

6 files changed

+44
-44
lines changed

src/Web/CSSOMView/Element.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ export function getBoundingClientRect(element) {
1414
};
1515
}
1616

17-
export function scrollIntoView(element) {
18-
return function (scrollIntoViewOptions) {
17+
export function scrollIntoView(scrollIntoViewOptions) {
18+
return function (element) {
1919
return function () {
2020
if (scrollIntoViewOptions.value0) {
2121
element.scrollIntoView({
@@ -29,24 +29,24 @@ export function scrollIntoView(element) {
2929
};
3030
}
3131

32-
export function scroll(element) {
33-
return function (scrollToOptions) {
32+
export function scroll(scrollToOptions) {
33+
return function (element) {
3434
return function () {
3535
element.scrollIntoView(convertScrollToOptions(scrollToOptions));
3636
};
3737
};
3838
}
3939

40-
export function scrollTo(element) {
41-
return function (scrollToOptions) {
40+
export function scrollTo(scrollToOptions) {
41+
return function (element) {
4242
return function () {
4343
element.scrollTo(convertScrollToOptions(scrollToOptions));
4444
};
4545
};
4646
}
4747

48-
export function scrollBy(element) {
49-
return function (scrollToOptions) {
48+
export function scrollBy(scrollToOptions) {
49+
return function (element) {
5050
return function () {
5151
element.scrollBy(convertScrollToOptions(scrollToOptions));
5252
};

src/Web/CSSOMView/Element.purs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import Web.CSSOMView (ScrollIntoViewOptions, ScrollToOptions)
99

1010
foreign import getClientRects :: Element -> Effect DOMRectList
1111
foreign import getBoundingClientRect :: Element -> Effect DOMRect
12-
foreign import scrollIntoView :: Element -> Maybe ScrollIntoViewOptions -> Effect Unit
13-
foreign import scroll :: Element -> Maybe ScrollToOptions -> Effect Unit
14-
foreign import scrollTo :: Element -> Maybe ScrollToOptions -> Effect Unit
15-
foreign import scrollBy :: Element -> Maybe ScrollToOptions -> Effect Unit
12+
foreign import scrollIntoView :: Maybe ScrollIntoViewOptions -> Element -> Effect Unit
13+
foreign import scroll :: Maybe ScrollToOptions -> Element -> Effect Unit
14+
foreign import scrollTo :: Maybe ScrollToOptions -> Element -> Effect Unit
15+
foreign import scrollBy :: Maybe ScrollToOptions -> Element -> Effect Unit
1616
foreign import scrollTop :: Element -> Effect Number
1717
foreign import scrollLeft :: Element -> Effect Number
1818
foreign import scrollWidth :: Element -> Effect Int

src/Web/CSSOMView/MediaQueryList.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ export function matches(mediaQueryList) {
1010
};
1111
}
1212

13-
export function addListener(mediaQueryList) {
14-
return function (callback) {
13+
export function addListener(callback) {
14+
return function (mediaQueryList) {
1515
return function () {
1616
mediaQueryList.addListener(callback);
1717
};
1818
};
1919
}
2020

21-
export function removeListener(mediaQueryList) {
22-
return function (callback) {
21+
export function removeListener(callback) {
22+
return function (mediaQueryList) {
2323
return function () {
2424
mediaQueryList.removeListener(callback);
2525
};

src/Web/CSSOMView/MediaQueryList.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ foreign import data MediaQueryList :: Type
99

1010
foreign import media :: MediaQueryList -> Effect String
1111
foreign import matches :: MediaQueryList -> Effect Boolean
12-
foreign import addListener :: MediaQueryList -> EventListener -> Effect Unit
13-
foreign import removeListener :: MediaQueryList -> EventListener -> Effect Unit
12+
foreign import addListener :: EventListener -> MediaQueryList -> Effect Unit
13+
foreign import removeListener :: EventListener -> MediaQueryList -> Effect Unit
1414

1515
toEventTarget :: MediaQueryList -> EventTarget
1616
toEventTarget = unsafeCoerce

src/Web/CSSOMView/Window.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ function getter(property) {
66
};
77
}
88

9-
export function matchMedia(window) {
10-
return function (query) {
9+
export function matchMedia(query) {
10+
return function (window) {
1111
return function () {
1212
return window.matchMedia(query);
1313
};
@@ -18,39 +18,39 @@ export function screen(window) {
1818
return window.screen;
1919
}
2020

21-
export function moveTo(window) {
22-
return function (x) {
23-
return function (y) {
21+
export function moveTo(x) {
22+
return function (y) {
23+
return function (window) {
2424
return function () {
2525
return window.moveTo(x, y);
2626
};
2727
};
2828
};
2929
}
3030

31-
export function moveBy(window) {
32-
return function (x) {
33-
return function (y) {
31+
export function moveBy(x) {
32+
return function (y) {
33+
return function (window) {
3434
return function () {
3535
return window.moveTo(x, y);
3636
};
3737
};
3838
};
3939
}
4040

41-
export function resizeTo(window) {
42-
return function (width) {
43-
return function (height) {
41+
export function resizeTo(width) {
42+
return function (height) {
43+
return function (window) {
4444
return function () {
4545
return window.moveTo(width, height);
4646
};
4747
};
4848
};
4949
}
5050

51-
export function resizeBy(window) {
52-
return function (x) {
53-
return function (y) {
51+
export function resizeBy(x) {
52+
return function (y) {
53+
return function (window) {
5454
return function () {
5555
return window.moveTo(x, y);
5656
};
@@ -79,8 +79,8 @@ export function scroll(window) {
7979
};
8080
}
8181

82-
export function scrollTo(window) {
83-
return function (options) {
82+
export function scrollTo(options) {
83+
return function (window) {
8484
return function () {
8585
if (typeof options.value0 === "object") {
8686
var newObject = Object.assign({}, options.value0);
@@ -93,8 +93,8 @@ export function scrollTo(window) {
9393
};
9494
}
9595

96-
export function scrollBy(window) {
97-
return function (options) {
96+
export function scrollBy(options) {
97+
return function (window) {
9898
return function () {
9999
if (typeof options.value0 === "object") {
100100
var newObject = Object.assign({}, options.value0);

src/Web/CSSOMView/Window.purs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import Web.CSSOMView (ScrollToOptions)
88
import Web.CSSOMView.Screen (Screen)
99
import Web.CSSOMView.MediaQueryList (MediaQueryList)
1010

11-
foreign import matchMedia :: Window -> String -> Effect MediaQueryList
11+
foreign import matchMedia :: String -> Window -> Effect MediaQueryList
1212
foreign import screen :: Window -> Screen
13-
foreign import moveTo :: Window -> Int -> Int -> Effect Unit
14-
foreign import moveBy :: Window -> Int -> Int -> Effect Unit
15-
foreign import resizeTo :: Window -> Int -> Int -> Effect Unit
16-
foreign import resizeBy :: Window -> Int -> Int -> Effect Unit
13+
foreign import moveTo :: Int -> Int -> Window -> Effect Unit
14+
foreign import moveBy :: Int -> Int -> Window -> Effect Unit
15+
foreign import resizeTo :: Int -> Int -> Window -> Effect Unit
16+
foreign import resizeBy :: Int -> Int -> Window -> Effect Unit
1717

1818
foreign import innerWidth :: Window -> Effect Int
1919
foreign import innerHeight :: Window -> Effect Int
@@ -23,9 +23,9 @@ foreign import pageXOffset :: Window -> Effect Number
2323
foreign import scrollY :: Window -> Effect Number
2424
foreign import pageYOffset :: Window -> Effect Number
2525

26-
foreign import scroll :: Window -> Maybe ScrollToOptions -> Effect Unit
27-
foreign import scrollTo :: Window -> Maybe ScrollToOptions -> Effect Unit
28-
foreign import scrollBy :: Window -> Maybe ScrollToOptions -> Effect Unit
26+
foreign import scroll :: Maybe ScrollToOptions -> Window -> Effect Unit
27+
foreign import scrollTo :: Maybe ScrollToOptions -> Window -> Effect Unit
28+
foreign import scrollBy :: Maybe ScrollToOptions -> Window -> Effect Unit
2929

3030
foreign import screenX :: Window -> Effect Int
3131
foreign import screenLeft :: Window -> Effect Int

0 commit comments

Comments
 (0)