aboutsummaryrefslogtreecommitdiff
path: root/src/shared/utils
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-10-23 20:10:05 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2017-10-23 20:10:05 +0900
commita57cdbd5b5f4efa94ecc61498fdb4039276f86f0 (patch)
treebbbb397223018d155fbe4e92bad5e681e78dff0b /src/shared/utils
parentccc81312a1d4d9a5cea7d7451c26ec25b2172aa8 (diff)
dom helper
Diffstat (limited to 'src/shared/utils')
-rw-r--r--src/shared/utils/dom.js8
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 };