Skip to content
This repository has been archived by the owner on Jan 23, 2021. It is now read-only.

Fix JS for 0.3-stable #351

Open
wants to merge 3 commits into
base: 0.3-stable
Choose a base branch
from

Conversation

akiko-pusu
Copy link
Owner

@akiko-pusu akiko-pusu commented Jun 17, 2020

This is related to #349
The 0.3-stable branch has also some errors with the Redmine trunk (using jQuery 3.x).

It seems Redmine developers have a plan as a workaround to migrate jQuery 3.x. :)
https://redmine.org/issues/33383
I've confirmed that my plugin 0.3-stable works fine.

So, this PR does not need to merge in a hurry.

Changeset

  • Code refactoring. (d9b0619)
  • Enabled to update the note template list when tracker or project id is changed. (9182a9f)

  • jQuery3.xでエラーが発生しないように書き換え。 (d9b0619)
    • 変数の引数をスッキリさせるようにする
  • チケット更新画面で、チケットのプロジェクトやトラッカーに変更があった場合、コメントテンプレート用の候補も抽出先を切り替えるように変更。 (9182a9f)

Need to confirm

  • Work fine with Redmine 4.1stable
  • Work fine with Redmine trunk (using jQuery3.x)
  • Work fine with CKEditor

@akiko-pusu akiko-pusu changed the title Fix JS Fix JS for 0.3-stable Jun 18, 2020
@akiko-pusu akiko-pusu force-pushed the issue-347-spec-fail-against-0.3-stable branch from ac400b9 to 5df0ae9 Compare June 18, 2020 23:50
@akiko-pusu akiko-pusu force-pushed the issue-347-spec-fail-against-0.3-stable branch from 8a6882f to d9b0619 Compare June 19, 2020 12:04
@@ -25,12 +25,11 @@
</td>
<td>
<a data-note-template-id="<%= template.id %>"
href="#" onclick="applyNoteTemplate(this, <%= template.id %>);"
data-note-template-load-url="<%= load_note_templates_url %>"
href="#" onclick="applyNoteTemplate(this);"
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data属性にセットして、JavaScriptの関数側から、対象イベントの要素を起点にdataset属性を使ってテンプレートのIDとリクエスト用のURLを引き渡すように変更。

Changed to define the template ID and request URL using HTML5 data-* attributes.
This allows the JavaScript function to get these values ​​through the target element.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant