Project

General

Profile

Patch #31433 » 0001-Use-the-regular-icon-icon-classes-for-sort-handler.patch

Marius BĂLTEANU, 2019-05-23 19:58

View differences:

app/helpers/application_helper.rb
:reorder_param => options[:param] || object.class.name.underscore
}
content_tag('span', '',
:class => "sort-handle",
:class => "icon-only icon-sort-handle sort-handle",
:data => data,
:title => l(:button_sort))
end
app/helpers/my_helper.rb
def render_block(block, user)
content = render_block_content(block, user)
if content.present?
handle = content_tag('span', '', :class => 'sort-handle', :title => l(:button_move))
handle = content_tag('span', '', :class => 'icon-only icon-sort-handle sort-handle', :title => l(:button_move))
close = link_to(l(:button_delete),
{:action => "remove_block", :block => block},
:remote => true, :method => 'post',
:remote => true, :method => 'post',
:class => "icon-only icon-close", :title => l(:button_delete))
content = content_tag('div', handle + close, :class => 'contextual') + content
app/views/custom_field_enumerations/index.html.erb
<ul id="custom_field_enumerations" class="flat">
<% @custom_field.enumerations.each_with_index do |value, position| %>
<li>
<span class="sort-handle"></span>
<span class="icon-only icon-sort-handle sort-handle"></span>
<%= hidden_field_tag "custom_field_enumerations[#{value.id}][position]", position, :class => 'position' %>
<%= text_field_tag "custom_field_enumerations[#{value.id}][name]", value.name, :size => 40 %>
<%= hidden_field_tag "custom_field_enumerations[#{value.id}][active]", 0 %>
public/stylesheets/application.css
.icon-add-bullet { background-image: url(../images/bullet_add.png); }
.icon-shared { background-image: url(../images/link.png); }
.icon-actions { background-image: url(../images/3_bullets.png); }
.icon-sort-handle { background-image: url(../images/reorder.png); }
.icon-file { background-image: url(../images/files/default.png); }
.icon-file.text-plain { background-image: url(../images/files/text.png); }
......
.icon-file.application-zip { background-image: url(../images/files/zip.png); }
.icon-file.application-x-gzip { background-image: url(../images/files/zip.png); }
.sort-handle { width:16px; height:16px; background:url(../images/reorder.png) no-repeat 0 50%; cursor:move; }
.sort-handle { cursor:move; }
.sort-handle.ajax-loading { background-image: url(../images/loading.gif); }
tr.ui-sortable-helper { border:1px solid #e4e4e4; }
(1-1/8)