Merge pull request #438 from abhishek-webkul/gli-1024
Fix page scroll issues at order history and order view page
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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');
|
||||
});
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user