Skip to content

Commit

Permalink
Move select2 images to asset pipeline
Browse files Browse the repository at this point in the history
png sprites? That was a flashback..
  • Loading branch information
dacook committed Feb 3, 2025
1 parent 858a242 commit 3c17296
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 20 deletions.
File renamed without changes
File renamed without changes
File renamed without changes
2 changes: 1 addition & 1 deletion app/views/spree/admin/product_properties/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
= form_for @product, url: admin_product_url(@product, @url_filters), method: :put do |f|
%fieldset.no-border-top
.add_product_properties
= image_pack_tag 'select2-spinner.gif', plugin: 'spree', style: 'display:none;', id: 'busy_indicator'
= image_tag 'select2-spinner.gif', plugin: 'spree', style: 'display:none;', id: 'busy_indicator'

%table.index.sortable{"data-sortable-link" => update_positions_admin_product_product_properties_url}
%thead
Expand Down
4 changes: 2 additions & 2 deletions app/views/spree/admin/states/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= render partial: 'spree/admin/shared/configuration_menu'
dmin= render partial: 'spree/admin/shared/configuration_menu'

- content_for :page_title do
= t("spree.states")
Expand All @@ -11,6 +11,6 @@
- databaseurl = "#{admin_states_path(format: :js)}?country_id="
%select#country.observe_field.select2.fullwidth{"data-base-url" => databaseurl, "data-update" => "#state-list"}
= options_from_collection_for_select(@countries, :id, :name, @country.id)
= image_pack_tag 'select2-spinner.gif', plugin: 'spree', style: 'display:none;', id: 'busy_indicator'
= image_tag 'select2-spinner.gif', plugin: 'spree', style: 'display:none;', id: 'busy_indicator'
#state-list
= render partial: 'state_list'
3 changes: 1 addition & 2 deletions config/webpacker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ default: &default
'vendor',
'app/webpacker/css',
'app/webpacker/fonts',
'app/webpacker/images',
'app/assets/images', # images should be outside of webpacker where possible
'app/assets/images',
'engines/web/app/assets/stylesheets',
'app/components'
]
Expand Down
30 changes: 15 additions & 15 deletions vendor/assets/stylesheets/select2.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Version: 3.4.3 Timestamp: Tue Sep 17 06:47:14 PDT 2013
text-decoration: none;

border: 0;
background: url('../images/select2.png') right top no-repeat;
background: url('/images/select2.png') right top no-repeat;
cursor: pointer;
outline: 0;
}
Expand Down Expand Up @@ -199,7 +199,7 @@ Version: 3.4.3 Timestamp: Tue Sep 17 06:47:14 PDT 2013
display: block;
width: 100%;
height: 100%;
background: url('../images/select2.png') no-repeat 0 1px;
background: url('/images/select2.png') no-repeat 0 1px;
}

.select2-search {
Expand Down Expand Up @@ -233,23 +233,23 @@ Version: 3.4.3 Timestamp: Tue Sep 17 06:47:14 PDT 2013
-webkit-box-shadow: none;
box-shadow: none;

background: #fff url('../images/select2.png') no-repeat 100% -22px;
background: url('../images/select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
background: url('../images/select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
background: url('../images/select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
background: url('../images/select2.png') no-repeat 100% -22px, linear-gradient(top, #fff 85%, #eee 99%);
background: #fff url('/images/select2.png') no-repeat 100% -22px;
background: url('/images/select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
background: url('/images/select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
background: url('/images/select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
background: url('/images/select2.png') no-repeat 100% -22px, linear-gradient(top, #fff 85%, #eee 99%);
}

.select2-drop.select2-drop-above .select2-search input {
margin-top: 4px;
}

.select2-search input.select2-active {
background: #fff url('../images/select2-spinner.gif') no-repeat 100%;
background: url('../images/select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
background: url('../images/select2-spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
background: url('../images/select2-spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
background: url('../images/select2-spinner.gif') no-repeat 100%, linear-gradient(top, #fff 85%, #eee 99%);
background: #fff url('/images/select2-spinner.gif') no-repeat 100%;
background: url('/images/select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
background: url('/images/select2-spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
background: url('/images/select2-spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
background: url('/images/select2-spinner.gif') no-repeat 100%, linear-gradient(top, #fff 85%, #eee 99%);
}

.select2-container-active .select2-choice,
Expand Down Expand Up @@ -393,7 +393,7 @@ disabled look for disabled choices in the results dropdown
}

.select2-more-results.select2-active {
background: #f4f4f4 url('../images/select2-spinner.gif') no-repeat 100%;
background: #f4f4f4 url('/images/select2-spinner.gif') no-repeat 100%;
}

.select2-more-results {
Expand Down Expand Up @@ -481,7 +481,7 @@ disabled look for disabled choices in the results dropdown
}

.select2-container-multi .select2-choices .select2-search-field input.select2-active {
background: #fff url('../images/select2-spinner.gif') no-repeat 100% !important;
background: #fff url('/images/select2-spinner.gif') no-repeat 100% !important;
}

.select2-default {
Expand Down Expand Up @@ -535,7 +535,7 @@ disabled look for disabled choices in the results dropdown

font-size: 1px;
outline: none;
background: url('../images/select2.png') right top no-repeat;
background: url('/images/select2.png') right top no-repeat;
}

.select2-container-multi .select2-search-choice-close {
Expand Down

0 comments on commit 3c17296

Please sign in to comment.