Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/DOM/Node/Element.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ exports._getAttribute = function (name) {
};
};

exports.hasAttribute = function(name) {
return function (element) {
return element.hasAttribute(name);
};
};

exports.removeAttribute = function (name) {
return function (element) {
return function () {
Expand Down
2 changes: 2 additions & 0 deletions src/DOM/Node/Element.purs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module DOM.Node.Element
, getElementsByClassName
, setAttribute
, getAttribute
, hasAttribute
, removeAttribute
, scrollTop
, setScrollTop
Expand Down Expand Up @@ -63,6 +64,7 @@ getAttribute :: forall eff. String -> Element -> Eff (dom :: DOM | eff) (Maybe S
getAttribute attr = map toMaybe <<< _getAttribute attr

foreign import _getAttribute :: forall eff. String -> Element -> Eff (dom :: DOM | eff) (Nullable String)
foreign import hasAttribute :: forall eff. String -> Element -> Eff (dom :: DOM | eff) Boolean
foreign import removeAttribute :: forall eff. String -> Element -> Eff (dom :: DOM | eff) Unit

foreign import scrollTop :: forall eff. Element -> Eff (dom :: DOM | eff) Number
Expand Down