Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Support confirmation_required button in simple input interface.
- Loading branch information
Showing
6 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
//= require application | ||
//= require ejs | ||
//= require view | ||
//= require toggle_confirmation_required |
14 changes: 14 additions & 0 deletions
14
app/assets/javascripts/toggle_confirmation_required.js.coffee
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
global = this | ||
global.toggleConfirmationRequired = (isRequired, item_id = null) -> | ||
if item_id | ||
label_selector = "#confirmation_required_label_" + item_id | ||
field_selector = "#confirmation_required_" + item_id | ||
else | ||
label_selector = "#confirmation_required_label" | ||
field_selector = "#confirmation_required" | ||
if isRequired | ||
$(label_selector).text("★").attr "class", "item_confirmation_required" | ||
$(field_selector).attr "value", "true" | ||
else | ||
$(label_selector).text("☆").attr "class", "item_confirmation_not_required" | ||
$(field_selector).attr "value", "false" |
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
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
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