Skip to content

Commit

Permalink
Merge pull request #1835 from asalani93/as_unhide_colorpicker
Browse files Browse the repository at this point in the history
Colorpicker no longer is cut off when dataset names are short
  • Loading branch information
kcarcia committed Nov 6, 2014
2 parents bf89e0d + a9ee617 commit 0ffdce7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ group :development, :test do
end

# Jquery stuff
gem 'better_colorpicker', '~> 0.0.2', git: 'https://github.com/asalani93/better-colorpicker'
gem 'better_colorpicker', '~> 0.0.3', git: 'https://github.com/asalani93/better-colorpicker'
gem 'jquery-rails'

# To use ActiveModel has_secure_password
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,12 @@ $ ->
class='group_input_all' type='checkbox' value='#{gIndex}'
#{if data.groupSelection.length == data.groups.length then "checked" else ""}>
#Check All</label></div>"""
controls += "</td><td>Color</td></tr>"
controls += "</td><td></td></tr>"

for group, gIndex in data.groups
color_id = counter % globals.configs.colors.length
color = globals.configs.colors[color_id]
controls += "<tr><td>"
controls += "<tr><td class='label-dataset-name'>"
controls += "<div class='inner_control_div' id='label-color-#{color_id}'"
controls += "style=\"color:#{color};\">"

Expand All @@ -288,8 +288,8 @@ $ ->
else
controls +="No #{data.fields[globals.configs.groupById].fieldName}</label>"
controls += "</div></div>"
controls += "</td><td>"
controls += """<a href="#" class="color-picker" data-color="#{color}" data-color-id="#{color_id}">
controls += "</td><td class='label-dataset-color'>"
controls += """<a href="javascript:void;" class="color-picker" data-color="#{color}" data-color-id="#{color_id}">
<img height="20px" width="20px" src="<%= image_path('color-wheel.png') %>"></a>"""
controls += "</td></tr>"
counter += 1
Expand Down
8 changes: 8 additions & 0 deletions app/assets/stylesheets/visualizations.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,14 @@ body[data-page-name='visualizations/show'] .visualizations-controller,
color: $hint;
}

.outer_control_div table {
width: 100%;
.label-dataset-color {
float: right;
width: 20px;
}
}

// photos sometimes needs a scrollbar
#photos_canvas {
overflow-y: auto;
Expand Down
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20141010131030) do
ActiveRecord::Schema.define(version: 20141015152508) do

create_table "contrib_keys", force: true do |t|
t.string "name", null: false
Expand Down

0 comments on commit 0ffdce7

Please sign in to comment.