Use cross-browser document.activeElement instead of (non-IE) event.target.activeElement

This commit is contained in:
riceyrice 2016-05-12 13:26:50 +01:00 committed by Matt Westcott
parent 4b775dbdc8
commit 396d1ac622
4 changed files with 4 additions and 1 deletions

View file

@ -5,6 +5,7 @@ Changelog
~~~~~~~~~~~~~~~~~~
* Fix: Paste / drag operations done entirely with the mouse are now correctly picked up as edits within the rich text editor (Matt Fozard)
* Fix: Logic for cancelling the "unsaved changes" check on form submission has been fixed to work cross-browser (Stephen Rice)
1.4.4 (10.05.2016)

View file

@ -120,6 +120,7 @@ Contributors
* Nick Smith
* João Luiz Lorencetti
* Jason Morrison
* Stephen Rice
Translators
===========

View file

@ -14,3 +14,4 @@ Bug fixes
~~~~~~~~~
* Paste / drag operations done entirely with the mouse are now correctly picked up as edits within the rich text editor (Matt Fozard)
* Logic for cancelling the "unsaved changes" check on form submission has been fixed to work cross-browser (Stephen Rice)

View file

@ -67,7 +67,7 @@ function enableDirtyFormCheck(formSelector, options) {
window.addEventListener('beforeunload', function(event) {
// Ignore if the user clicked on an ignored element
var triggeredByIgnoredButton = false;
var $trigger = $(event.target.activeElement);
var $trigger = $(event.explicitOriginalTarget || document.activeElement);
$ignoredButtons.each(function() {
if ($(this).is($trigger)) {