Skip to content

Commit

Permalink
* Added class manipulation
Browse files Browse the repository at this point in the history
  • Loading branch information
spockz committed Jan 18, 2012
1 parent 609f869 commit 254afcb
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions uhc-jscript/src/Language/UHC/JScript/JQuery/JQuery.hs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -121,6 +121,27 @@ foreign import jscript "%1.addClass(%2)"
foreign import jscript "%1.remove()" foreign import jscript "%1.remove()"
remove :: JQuery -> IO () 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 -- Effects


Expand Down

0 comments on commit 254afcb

Please sign in to comment.