Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* Added class manipulation

  • Loading branch information...
commit 254afcb8aef9c64fde011060dea7907532c10ae6 1 parent 609f869
Alessandro Vermeulen authored
Showing with 21 additions and 0 deletions.
  1. +21 −0 uhc-jscript/src/Language/UHC/JScript/JQuery/JQuery.hs
21 uhc-jscript/src/Language/UHC/JScript/JQuery/JQuery.hs
View
@@ -121,6 +121,27 @@ foreign import jscript "%1.addClass(%2)"
foreign import jscript "%1.remove()"
remove :: JQuery -> IO ()
+toggleClass :: JQuery -> String -> IO ()
+toggleClass jq = _toggleClass jq . toJS
+
+toggleClassString :: String -> String -> IO ()
+toggleClassString sel c = jQuery sel >>= flip toggleClass c
+
+foreign import jscript "%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
+
+removeClassString :: String -> String -> IO ()
+removeClassString sel c = jQuery sel >>= flip removeClass c
+
+foreign import jscript "%1.removeClass(%2)"
+ _removeClass :: JQuery -> JSString -> IO ()
+
+
-------------------------------------------------------------------------------
-- Effects
Please sign in to comment.
Something went wrong with that request. Please try again.