diff --git a/admin/themes/default/js/admin-theme.js b/admin/themes/default/js/admin-theme.js index 922168b95..fc7d85e69 100644 --- a/admin/themes/default/js/admin-theme.js +++ b/admin/themes/default/js/admin-theme.js @@ -86,9 +86,8 @@ function error_modal(heading, msg) { } //move to hash after clicking on anchored links -function scroll_if_anchor(href) { +function scroll_if_anchor(href, fromTop = 120) { href = typeof(href) === "string" ? href : $(this).attr("href"); - var fromTop = 120; if(href.indexOf("#") === 0) { var $target = $(href); if($target.length) { diff --git a/js/admin/orders.js b/js/admin/orders.js index 4f339d5d1..fce74f114 100644 --- a/js/admin/orders.js +++ b/js/admin/orders.js @@ -326,16 +326,17 @@ function init() $('.edit_product_fields, .standard_refund_fields, .partial_refund_fields, .order_action').hide(); $('tr#new_product').slideDown('fast', function () { - $('tr#new_product td').fadeIn('fast', function() { + $('tr#new_product td').fadeIn('fast').promise().done(function () { $('#add_product_product_name').focus(); - scroll_if_anchor('#new_product'); + scroll_if_anchor('#new_product', 360); }); }); + e.preventDefault(); }); $('#cancelAddProduct').unbind('click').click(function() { - $('.order_action').show(); + $('.order_action').not('.standard_refund_fields').show(); $('tr#new_product td').fadeOut('fast'); }); diff --git a/themes/hotel-reservation-theme/js/history.js b/themes/hotel-reservation-theme/js/history.js index 12336d90f..717a90f94 100644 --- a/themes/hotel-reservation-theme/js/history.js +++ b/themes/hotel-reservation-theme/js/history.js @@ -156,6 +156,11 @@ function sendOrderMessage() } $(document).ready(function(){ + var page = $('html, body'); + page.on('mousewheel', function () { + page.stop(); + }); + // If customer clicks for refund request then toggle refund request fields $('body').on('click', '#order_refund_request', function(e) { e.preventDefault();