agusmakmun / agusmakmun/django-markdown-editor

Multiple markdowns on Django TabularInline admin model page, ace edit find dynamic generated #id item error

オープン
#132 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
901
フォーク
1.3k
PR マージ指標
30日以内にマージされた PR はありません

説明

Hi,

I've a model with a TabularInline configuration: It's a simple article with possibility to add some translations.
This is the situation where I show only languages edited by user:

![image](https://user-images.githubusercontent.com/8039989/89634619-faf84700-d8a5-11ea-8d0f-2cc10535a336.png)

In this case, user added two translations. If I click on "Add another article translation", this is the result:

![image](https://user-images.githubusercontent.com/8039989/89634765-2a0eb880-d8a6-11ea-96d1-d5dab5b98c60.png)

Text area is blocked, and it's showed this javascript exception:

```
ace.js:5 Uncaught Error: ace.edit can't find div #martor-articles-articles2-content
at Object.t.edit (ace.js:5)
at HTMLDivElement. (martor.min.js:9)
at Function.each (jquery.js:367)
at jQuery.fn.init.each (jquery.js:202)
at jQuery.fn.init.e.fn.martor (martor.min.js:9)
at HTMLDivElement. (martor.min.js:9)
at Function.each (jquery.min.js:2)
at w.fn.init.each (jquery.min.js:2)
at HTMLDocument. (martor.min.js:9)
at HTMLDocument.dispatch (jquery.min.js:2)
```

Searching in the sources, I've found that the correct ID created dynamically was `#martor-articles-2-content` NOT `#martor-articles-articles2-content`:

![image](https://user-images.githubusercontent.com/8039989/89635064-aef9d200-d8a6-11ea-9678-013ec9b5642e.png)

Is there a way to solve this mismatch?

Thank you,
Mauro

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。