forked from OpenNeo/impress
checkbox for closet management
drop the remove link (just use quantity: 0) to create a bigger checkbox label target
This commit is contained in:
parent
9108703dd0
commit
0aca529e27
3 changed files with 29 additions and 3 deletions
|
@ -92,6 +92,15 @@
|
|||
var quantityEl = hangerEl.find("div.quantity");
|
||||
var quantity = hangerEl.data("quantity");
|
||||
|
||||
// Ooh, this part is weird. We only want the name to be linked, so
|
||||
// lift everything else out.
|
||||
var label = $('<label />');
|
||||
var checkbox = $('<input type="checkbox" />').appendTo(label);
|
||||
var link = hangerEl.children('a');
|
||||
link.children(':not(.name)').detach().appendTo(label);
|
||||
link.detach().appendTo(label);
|
||||
label.appendTo(hangerEl);
|
||||
|
||||
$.tmpl("updateFormTmpl", {
|
||||
user_id: currentUserId,
|
||||
closet_hanger_id: hangerId,
|
||||
|
|
|
@ -112,6 +112,21 @@ body.closet_hangers-index
|
|||
.quantity
|
||||
display: none
|
||||
|
||||
a
|
||||
/* It's jarring to have line-height gaps in the linkiness. */
|
||||
display: block
|
||||
|
||||
&:hover
|
||||
text-decoration: underline
|
||||
|
||||
input[type=checkbox]
|
||||
display: none
|
||||
position: absolute
|
||||
top: 0
|
||||
right: ($object-width - $object-img-size) / 2 + $object-padding
|
||||
height: 16px
|
||||
width: 16px
|
||||
|
||||
.closet-hangers-group
|
||||
border-top: 1px solid $module-border-color
|
||||
margin-bottom: 2em
|
||||
|
@ -315,6 +330,9 @@ body.closet_hangers-index
|
|||
input[type=submit]
|
||||
font-size: 85%
|
||||
|
||||
input[type=checkbox]
|
||||
display: block
|
||||
|
||||
&.js
|
||||
#closet-hangers
|
||||
.object:hover .quantity
|
||||
|
|
|
@ -121,8 +121,7 @@
|
|||
min: 0, required: true
|
||||
|
||||
%script#closet-hanger-destroy-tmpl{type: 'text/x-jquery-tmpl'}
|
||||
= form_tag templated_hanger_path, method: :delete, authenticity_token: false, class: 'closet-hanger-destroy' do
|
||||
= submit_tag t('closet_hangers.closet_hanger.delete')
|
||||
-# TODO: remove me?
|
||||
|
||||
- content_for :stylesheets do
|
||||
= stylesheet_link_tag 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.0/themes/south-street/jquery-ui.css'
|
||||
|
|
Loading…
Reference in a new issue