Unverified Commit b4f4371f authored by colemanw's avatar colemanw Committed by GitHub

Merge pull request #11790 from GinkgoFJG/dev/core#12-crmWizard-scrollup

#12: Added auto-scroll-up functionality between steps to crmUiWizard
parents aa7804d6 510eb730
......@@ -875,6 +875,20 @@
},
link: function (scope, element, attrs) {
scope.ts = CRM.ts(null);
element.find('.crm-wizard-buttons button').click(function () {
// These values are captured inside the click handler to ensure the
// positions/sizes of the elements are captured at the time of the
// click vs. at the time this directive is initialized.
var topOfWizard = element.offset().top;
var heightOfMenu = $('#civicrm-menu').height() || 0;
$('html')
// stop any other animations that might be happening...
.stop()
// gracefully slide the user to the top of the wizard
.animate({scrollTop: topOfWizard - heightOfMenu}, 1000);
});
}
};
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment