Permalink
Browse files

Add a removeClass without params. Rename existing removeClass to

removeClass'
  • Loading branch information...
1 parent 3b3345f commit 708e0c262346924bdde0933091d9c3a7f4a962ab @norm2782 norm2782 committed Apr 2, 2012
Showing with 14 additions and 10 deletions.
  1. +14 −10 uhc-js/src/Language/UHC/JScript/JQuery/JQuery.hs
@@ -117,16 +117,16 @@ foreign import js "%1.hide()"
addClass :: JQuery -> String -> IO ()
addClass j s = _addClass j (toJS s)
+ -- Or return JQuery for chaining??? Does chaining even make sense?
+foreign import js "%1.addClass(%2)"
+ _addClass :: JQuery -> JSString -> IO ()
+
wrapInner :: JQuery -> String -> IO ()
wrapInner j = _wrapInner j . toJS
foreign import js "%1.wrapInner(%2)"
_wrapInner :: JQuery -> JSString -> IO ()
- -- Or return JQuery for chaining??? Does chaining even make sense?
-foreign import js "%1.addClass(%2)"
- _addClass :: JQuery -> JSString -> IO ()
-
foreign import js "%1.remove()"
remove :: JQuery -> IO ()
@@ -138,17 +138,21 @@ toggleClassString sel c = jQuery sel >>= flip toggleClass c
foreign import js "%1.toggleClass(%2)"
_toggleClass :: JQuery -> JSString -> IO ()
-
+
-- | One or more space-separated classes to be removed from the class attribute
-- of each matched element.
-removeClass :: JQuery -> String -> IO ()
-removeClass jq = _removeClass jq . toJS
+
+removeClass' :: JQuery -> String -> IO ()
+removeClass' jq = _removeClass' jq . toJS
removeClassString :: String -> String -> IO ()
-removeClassString sel c = jQuery sel >>= flip removeClass c
+removeClassString sel c = jQuery sel >>= flip removeClass' c
+
+foreign import js "%1.removeClass()"
+ removeClass :: JQuery -> IO ()
foreign import js "%1.removeClass(%2)"
- _removeClass :: JQuery -> JSString -> IO ()
+ _removeClass' :: JQuery -> JSString -> IO ()
-------------------------------------------------------------------------------
@@ -340,4 +344,4 @@ loadSrcFile src = do let src' = toJS src :: JSString
scriptTag <- jQuery "<script>"
scriptTag' <- setAttr "src" src' scriptTag
body <- jQuery "body"
- append body scriptTag'
+ append body scriptTag'

0 comments on commit 708e0c2

Please sign in to comment.