This repository was archived by the owner on Jan 23, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 124
Fix JS for 0.3-stable #351
Open
akiko-pusu
wants to merge
3
commits into
0.3-stable
Choose a base branch
from
issue-347-spec-fail-against-0.3-stable
base: 0.3-stable
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ac400b9
to
5df0ae9
Compare
Format code.
8a6882f
to
d9b0619
Compare
akiko-pusu
commented
Jun 20, 2020
@@ -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);" |
There was a problem hiding this comment.
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を引き渡すように変更。
- Ref: https://developer.mozilla.org/ja/docs/Learn/HTML/Howto/Use_data_attributes
- JavaScriptの関数側ではなるべく rubyの変数を直に入り込ませないように修正、できるだけ *.jsに寄せるための準備。
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.
- Ref: https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes
- Try not to inject Ruby variables directly into JavaScript functions as possible.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Need to confirm