Skip to content

Commit

Permalink
Use jsaddle instead of jQuery and FFI
Browse files Browse the repository at this point in the history
  • Loading branch information
mightybyte committed Sep 20, 2018
1 parent 778e7d5 commit 1dcc3bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
8 changes: 2 additions & 6 deletions reflex-dom-semui.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,15 @@ library
, containers
, data-default
, file-embed >= 0.0.10 && < 0.1
, ghcjs-base
, ghcjs-dom
, jsaddle >= 0.8.0.0 && < 0.10
, lens
, mtl
, reflex >= 0.5 && < 0.6
, reflex-dom-core >= 0.4 && < 0.5
, text

if impl(ghcjs)
build-depends: ghcjs-base
else
build-depends:
jsaddle >= 0.8.0.0 && < 0.10
, lens

ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-orphans
cpp-options: -D_GHCJS_ -DGHCJS_GC_INTERVAL=60000
Expand Down
8 changes: 0 additions & 8 deletions src/Reflex/Dom/SemanticUI/Modal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ module Reflex.Dom.SemanticUI.Modal where
import Control.Monad.Trans
import Data.Text (Text)
import qualified GHCJS.DOM.Types as DOM
#ifndef ghcjs_HOST_OS
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import Language.Javascript.JSaddle.Object (js1, jsg1)
#endif
import Reflex.Dom.Core
------------------------------------------------------------------------------

Expand Down Expand Up @@ -84,12 +82,6 @@ uiTriggerModalAction :: DOM.Element -> ModalBehavior -> DOM.JSM ()
uiTriggerModalAction e beh = js_modalAction e
(DOM.toJSString $ modalBehaviorString beh)

#ifdef ghcjs_HOST_OS
foreign import javascript unsafe "jQuery($1)['modal']($2);"
js_modalAction :: DOM.Element -> DOM.JSString -> IO ()
#else
js_modalAction :: DOM.Element -> DOM.JSString -> DOM.JSM ()
js_modalAction e beh =
void $ jsg1 ("$"::Text) e ^. js1 ("modal"::Text) beh
#endif

0 comments on commit 1dcc3bb

Please sign in to comment.