From 27d1ad831808878552d2fcf6bf5b1b7711139a88 Mon Sep 17 00:00:00 2001 From: joakin Date: Tue, 14 Feb 2017 21:16:25 +0100 Subject: [PATCH] Hygiene: Remove unnecessary IIFE in changeListeners/render.js Change-Id: Ib313ddd52d59c6422e02d98b67b5b475b35e79b7 --- resources/dist/index.js | Bin 128322 -> 128316 bytes resources/dist/index.js.map | Bin 162202 -> 162145 bytes src/changeListeners/render.js | 38 ++++++++++++++++------------------ 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/resources/dist/index.js b/resources/dist/index.js index e0b910055ca9cdd37afc89e0536b48cbb1ff70f7..6e097e70a73cd52d6ef018f14f7a19b784ab42f0 100644 GIT binary patch delta 542 zcmXw#?@JSL9LM>_>~`zNIk#@}?zT?6Q8!HHwnk#3Mhy!p3pXE(A8L!bTwK6-G~lq6Z>^MbDalKoAk#bUpgO3qCJiyx%vNl?Jn{2qcPt zpkPrrh7sWuwyirYDC8WLgdo!|t33{uh56DAe}^4^1P>by9l*N?8C{5r0WNv~irRy` zR@92<6TBpZX|V@S1xAlWi61-S0>%;^`bw%QB#cO+mqajRoS>zI=ERzG(*FNjpL;?) z2qoHZtIFd=vIG9%POK*xs96{0e=wM>*x`1#5Mn%dm<_`m=8sI~it?kPHd)Y0Fwc0g zIpV`^Nb6n;$GssqGeOKJY*@bLso&tqTY}FyMZZ|HdaX`cOJ{9Zoly0ggQOj^Nf#Z>JZ7*s z)!ouvZtg)d<9QD8vf5P9y@?M;@qDI_ew!LSj0&z}^QRBbDjcnqx7t9eDrD16S7$yk z*j?zxSUHIM4Hn?q7cYcPOj)xb9KjQz1)|t#3mrpL>~@7ErI+WpoN;}`$Qe1) zt^O^cq~&Nw77~p0Us;G4L4$qcDtlVH!(cvpUrqMnA~rs zy2uSz!2_wzVJ7K8;@vJd>R#jr-H^Wo@j2;pbNMSdDVsC$qedahb3BI&^Sy|qw03T1 zE1i(W3TpO7b|O2jBA3$fFcrh6RKMr{g_;>1F%Bt~9BMjXI*BM&PLamGR<5})UsCWOZpYh-n_+2T z4>FbDKcmAd2ig7QqYk8(6xOVDJ20>uGJmMVv*Fd(POQ|1FgD4}W?I?phR=rJYLDe~ zoHf@9Z3r~v?I^~Yf5_@^VN-L2B!#z-r`P(?tht`)WVJQX3|f^Qs3v)ea`?TujoeaQ z^itGrx_H_FKHU)UDt&qDDIFKTC(OHE+6uFyeBRFz#ivyL<)2umMcKC9lHP*Dp{N+oJK`G}O^V8_Tl z?vJSHQzt1_)zYmYqL$MNGR4u0LP0w=-yx6iq{~e2xJijdEx&h?6h}AOh`kW0kW&KD dXzBeR3CgeB#8pP$r4L8sav!;^cm^{2{U68U<1zpM delta 576 zcmZvYUr1AN6vsKYIk#Qs?$+46bGGSng9&Syb6a7_nn~#TqXk8)HEM!T?P5-Sh+ako z{SoOv2g<^yUV>1r@Pm?eeF^HpdXS!*P*?^IBk0eF?po1H59i^0Ip=#m-&5Ss-~Ftg z>b6EQ?HxnWaJn;;$#k@*w}*nEPAqQPGB@%O@G%JT6K;URBzHirt1;OyxU~jt&1Sq~ z6tMrK1BGoO3Kj#N2${H891n}F_+Y;Yl?FeSEIV+fj+bZKhHSWe#)DEq{9UCWkGIku zR7??+yuIp>2bZE+dDfY&$NRiN_Q#C=|ANVV=gtn$R1!>-o&hT^t?H?egnIn`tO<{d zZYF^T3%-(ESbl53^*208&0wb3A!xwvO`p4!3j zPfNMrQ!RZERZV3T*<~NB3Dn|J`_pbt!>&c(f|2@s)g2wP?}L|G8je)wz35+U!aYA~ z)gU^SNWdj6ed&P~wl)YibX4qz?n-c`2EWSDi@`sxSbh{`(<$h&Q7#FM6&fAWjKLL- z;wiPSe2vKypyz2NSH0w98+q^<==#K8l3kN%L84u3eS;-Dx Lfjz$s_ul^k&YI5y diff --git a/src/changeListeners/render.js b/src/changeListeners/render.js index cf8ecd5ca..3e92601a7 100644 --- a/src/changeListeners/render.js +++ b/src/changeListeners/render.js @@ -1,23 +1,21 @@ -( function ( mw ) { +var renderer = require( '../renderer' ); - /** - * Creates an instance of the render change listener. - * - * @param {ext.popups.PreviewBehavior} previewBehavior - * @return {ext.popups.ChangeListener} - */ - module.exports = function ( previewBehavior ) { - var preview; +/** + * Creates an instance of the render change listener. + * + * @param {ext.popups.PreviewBehavior} previewBehavior + * @return {ext.popups.ChangeListener} + */ +module.exports = function ( previewBehavior ) { + var preview; - return function ( prevState, state ) { - if ( state.preview.shouldShow && !preview ) { - preview = mw.popups.renderer.render( state.preview.fetchResponse ); - preview.show( state.preview.activeEvent, previewBehavior ); - } else if ( !state.preview.shouldShow && preview ) { - preview.hide(); - preview = undefined; - } - }; + return function ( prevState, state ) { + if ( state.preview.shouldShow && !preview ) { + preview = renderer.render( state.preview.fetchResponse ); + preview.show( state.preview.activeEvent, previewBehavior ); + } else if ( !state.preview.shouldShow && preview ) { + preview.hide(); + preview = undefined; + } }; - -}( mediaWiki ) ); +};