Skip to content

Commit

Permalink
placed contrast preview input below suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
jdan committed Jul 22, 2015
1 parent bf3b328 commit 454216e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion plugins/contrast/error-description.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
</span>
</span>

has a ratio of <strong>{{suggestedColorsRatio}}</strong> <input class="previewCb" type="checkbox">
has a ratio of <strong>{{suggestedColorsRatio}}</strong>
<br />

<label>
Preview:
<input class="preview-contrast-fix" type="checkbox">
</label>
</div>
</div>
4 changes: 2 additions & 2 deletions plugins/contrast/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class ContrastPlugin extends Plugin {

// Add click handler to preview checkbox.
let $description = $(descriptionTemplate(templateData));
$description.find(".previewCb").click(function() {
if (this.checked) {
$description.find(".preview-contrast-fix").click((e) => {
if ($(e.target).prop("checked")) {
// Set suggested colors.
$(el).css("color", suggestedColors.fg);
$(el).css("background-color", suggestedColors.bg);
Expand Down

0 comments on commit 454216e

Please sign in to comment.