diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-10-23 20:10:05 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-10-23 20:10:05 +0900 |
commit | a57cdbd5b5f4efa94ecc61498fdb4039276f86f0 (patch) | |
tree | bbbb397223018d155fbe4e92bad5e681e78dff0b /src/shared/utils | |
parent | ccc81312a1d4d9a5cea7d7451c26ec25b2172aa8 (diff) |
dom helper
Diffstat (limited to 'src/shared/utils')
-rw-r--r-- | src/shared/utils/dom.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/shared/utils/dom.js b/src/shared/utils/dom.js new file mode 100644 index 0000000..c111ee7 --- /dev/null +++ b/src/shared/utils/dom.js @@ -0,0 +1,8 @@ +const isContentEditable = (element) => { + return element.hasAttribute('contenteditable') && ( + element.getAttribute('contenteditable').toLowerCase() === 'true' || + element.getAttribute('contenteditable').toLowerCase() === '' + ); +}; + +export { isContentEditable }; |