예를 들어 ACE 편집기가 새 소스 코드 구문 분석을 끝내면 모든 후속 .ace_identifier
DOM 노드에 클릭 이벤트 수신기를 추가 할 수 있도록 함수를 호출하고 싶습니다. 당신이 editor.renderer
에 afterRender
이벤트를 사용할 수,ACE 편집기 "구문 분석 끝"이벤트
editor = ace.edit $('#editor')
editor.setReadOnly true
// editor change event - never triggered in this case
editor.getSession().on 'change', (e) ->
console.log e
// changing the language makes ACE parse the source code and generates
// a new DOM...
editor.getSession().setMode "ace/mode/javascript"
// ... but a this point, $('.ace_identifier') returns a empty array
// instead of the expected list of ace_identifiers created
console.log $('.ace_identifier')
도움이 될 수 있습니다, 나는 실제로'.ace_identifier' DOM의를 선택 만에 클릭 이벤트 처리기를 설정하면 작동하지 않을 수 있어요. –
자, 포인터 이벤트를 추가 할 수 있습니다 : 자동 스타일. 하지만 모든 노드에 이벤트 처리기를 추가하는 것은 매우 나쁜 생각입니다. editor.on ("click"listener와'session.getToken' 대신에 –
을 사용해야합니다.이 'pointer-events'가 none으로 설정되었음을 어떻게 알았습니까? ! 나는 이것 때문에 너무 많은 에너지와 시간을 보냈다! 나는 나중에 최적화 된 방법을 사용할 것이다. 이것은 지금까지 프로토 타이핑을위한 것이다. –