Skip to content

Commit

Permalink
feat: init disabled task in viewer (#1163)
Browse files Browse the repository at this point in the history
* feat: init disabled task in viewer

* feat: apply code review
  • Loading branch information
seonim-ryu authored Aug 28, 2020
1 parent 60e747a commit 151f98e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/editor/src/js/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { sanitizeLinkAttribute } from './utils/common';
import htmlSanitizer from './htmlSanitizer';

const TASK_ATTR_NAME = 'data-te-task';
const DISABLED_TASK_ATTR_NAME = 'data-te-task-disabled';
const TASK_CHECKED_CLASS_NAME = 'checked';

/**
Expand Down Expand Up @@ -138,6 +139,7 @@ class ToastUIEditorViewer {
const style = getComputedStyle(ev.target, ':before');

if (
!ev.target.hasAttribute(DISABLED_TASK_ATTR_NAME) &&
ev.target.hasAttribute(TASK_ATTR_NAME) &&
domUtils.isInsideTaskBox(style, ev.offsetX, ev.offsetY)
) {
Expand Down

0 comments on commit 151f98e

Please sign in to comment.