Skip to content
This repository has been archived by the owner on May 14, 2022. It is now read-only.

Commit

Permalink
Try changes to selecting.
Browse files Browse the repository at this point in the history
  • Loading branch information
Trey Terrell committed Dec 8, 2015
1 parent 84581b7 commit 7190b1c
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 37 deletions.
7 changes: 4 additions & 3 deletions app/assets/javascripts/bulk_label.es6
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
class BulkLabeler {
constructor() {
this.element = $("*[data-action=bulk-label]")
this.actions_element = new window.LabelerActionsManager(this.element.children(".actions"))
this.actions_element = new window.LabelerActionsManager(this.element.find(".actions"))
$("#foliate-settings").hide()
this.element.children("ul").selectable(
$("#order-grid").selectable(
{
filter: ".panel",
stop: this.stopped_label_select,
selecting: this.shift_enabled_selecting
}
Expand Down Expand Up @@ -130,7 +131,7 @@ class BulkLabeler {
}

get selected_elements() {
return this.element.find("li.ui-selected")
return this.element.find("li .panel.ui-selected")
}

get stopped_label_select() {
Expand Down
4 changes: 2 additions & 2 deletions app/assets/stylesheets/components/bulk_label.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
.attributes {
@extend .col-xs-6;
}
&.ui-selecting {
.ui-selecting .panel-body {
background: #FECA40;
}
&.ui-selected {
.ui-selected .panel-body {
background: #F39814;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="actions col-xs-3 form-horizontal">
<div class="actions form-horizontal">
<div class="form-group">
<%= label_tag "start_with", "Start With:", class: "col-sm-4 control-label" %>
<div class="col-sm-8">
Expand Down
68 changes: 37 additions & 31 deletions app/views/curation_concerns/scanned_resources/bulk_edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,40 +13,46 @@

<div data-action="bulk-label">
<div class="col-xs-3">
<%= link_to "Back to Parent", polymorphic_path([main_app, @presenter]) %>
</div>
<div class="col-xs-8">
<div class="btn-group col-xs-12" role="group" data-action="list-toggle">
<button type="button" class="btn btn-default active list" aria-label="List">
<span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
</button>
<button type="button" class="btn btn-default grid" aria-label="Grid">
<span class="glyphicon glyphicon-th" aria-hidden="true"></span>
</button>
<div class="col-xs-12">
<%= link_to "Back to Parent", polymorphic_path([main_app, @presenter]) %>
</div>
<div class="col-xs-12">
<%= render "bulk_edit_actions" %>
</div>
</div>
<%= render "bulk_edit_actions" %>
<ul id="sortable" data-id="<%= @presenter.id %>" class="list-unstyled col-xs-8">
<% @members.each do |member| %>
<li data-reorder-id='<%= member.id %>'>
<%= simple_form_for [main_app, member], remote: true do |f| %>
<div class="panel panel-default">
<div class="panel-heading">
<%= f.input :title, as: :string, input_html: { name: "file_set[title][]" }, value: member.to_s, label: false %>
</div>
<div class="panel-body">
<div class="text-center thumbnail">
<%= render_thumbnail_tag member %>
</div>
<div class="attributes">
<%= f.input :viewing_hint, collection: [:"", :"non-paged", :"facing-pages"], as: :radio_buttons, label: false, defaults: { input_html: { class: '' }}%>
<div class="col-xs-8" id="order-grid">
<div class="col-xs-12">
<div class="btn-group col-xs-12" role="group" data-action="list-toggle">
<button type="button" class="btn btn-default active list" aria-label="List">
<span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
</button>
<button type="button" class="btn btn-default grid" aria-label="Grid">
<span class="glyphicon glyphicon-th" aria-hidden="true"></span>
</button>
</div>
</div>
<ul id="sortable" data-id="<%= @presenter.id %>" class="list-unstyled col-xs-12">
<% @members.each do |member| %>
<li data-reorder-id='<%= member.id %>'>
<%= simple_form_for [main_app, member], remote: true do |f| %>
<div class="panel panel-default">
<div class="panel-heading">
<%= f.input :title, as: :string, input_html: { name: "file_set[title][]" }, value: member.to_s, label: false %>
</div>
<div class="spacer">
<div class="panel-body">
<div class="text-center thumbnail">
<%= render_thumbnail_tag member %>
</div>
<div class="attributes">
<%= f.input :viewing_hint, collection: [:"", :"non-paged", :"facing-pages"], as: :radio_buttons, label: false, defaults: { input_html: { class: '' }}%>
</div>
<div class="spacer">
</div>
</div>
</div>
</div>
<% end %>
</li>
<% end %>
</ul>
<% end %>
</li>
<% end %>
</ul>
</div>
</div>

0 comments on commit 7190b1c

Please sign in to comment.