Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change text color to blue for different columns when displaying Drift for VM #3938

Merged
merged 1 commit into from
May 16, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions app/controllers/application_controller/compare.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1213,10 +1213,11 @@ def drift_add_section_field_expanded(view, section, field)
elsif fld[:_match_]
img_bkg = "cell-bkg-plain-no-shade"
else
style = "color: #21a0ec;" if fld[:_match_] == false
img_bkg = "cell-bkg-plain-mark-txt-no-shade"
unset_same_flag
end
row.merge!(drift_add_txt_col(idx, val, img_bkg))
row.merge!(drift_add_txt_col(idx, val, img_bkg, style))
end
row
end
Expand All @@ -1240,8 +1241,12 @@ def drift_add_image_col(idx, img_src, img_bkg, val)
{"col#{idx + 1}".to_sym => html}
end

def drift_add_txt_col(idx, col, img_bkg)
html_text = "<div class='#{img_bkg}'>#{col}</div>"
def drift_add_txt_col(idx, col, img_bkg, style = nil)
html_text = if style
"<div class='#{img_bkg}' style='#{style}'>#{col}</div>"
else
"<div class='#{img_bkg}'>#{col}</div>"
end
{"col#{idx + 1}".to_sym => html_text}
end

Expand Down