Merge pull request #257 from wvengen/feature-touchclick

Better workaround for touch devices
This commit is contained in:
wvengen 2014-02-03 06:33:27 -08:00
commit 6e0489b25f
7 changed files with 84 additions and 24 deletions

View file

@ -1,7 +1,7 @@
- content_for :javascript do
:javascript
$(function() {
$('#stock_changes').on('click', '.destroy_stock_change', function() {
$('#stock_changes').on('touchclick', '.destroy_stock_change', function() {
$(this).prev('input').val('1'); // check for destruction
var stock_change = $(this).closest('tr');
@ -11,7 +11,7 @@
return false;
});
$('#stock_changes').on('click', '.remove_new_stock_change', function() {
$('#stock_changes').on('touchclick', '.remove_new_stock_change', function() {
var stock_change = $(this).closest('tr');
stock_change.remove();
mark_article_for_delivery( stock_change.data('id') );

View file

@ -5,12 +5,12 @@
var ordergroup = "#{escape_javascript(render('ordergroup'))}"
$(function() {
$(document).on('click', 'a[data-remove-transaction]', function() {
$(document).on('touchclick', 'a[data-remove-transaction]', function() {
$(this).parents('tr').remove();
return false;
});
$(document).on('click', 'a[data-add-transaction]', function() {
$(document).on('touchclick', 'a[data-add-transaction]', function() {
$('#ordergroups').append(ordergroup);
return false;
});

View file

@ -10,7 +10,7 @@
theme: 'facebook'
});
$('#message_sent_to_all').click(function() {
$('#message_sent_to_all').on('touchclick', function() {
if ($(this).is(':checked')) {
$('#recipients').slideUp();
} else {

View file

@ -36,7 +36,7 @@
update_delta(this);
});
$(document).on('click', '#order_articles .unlocker', unlock_receive_input_field);
$(document).on('touchclick', '#order_articles .unlocker', unlock_receive_input_field);
$(function() {
$('input[data-units-expected]').each(function() {