aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2011-09-07 21:02:13 -0400
committertimmywil <timmywillisn@gmail.com>2011-09-19 15:42:31 -0400
commit9aa553aa18e79989dfa002ae5a295f626951bdf5 (patch)
tree897f836dd5b0c2367b52751bcf9b01fdf28980fd
parentecd10464e8659b008e52161cc029f9d6863e33b3 (diff)
downloadjquery-9aa553aa18e79989dfa002ae5a295f626951bdf5.tar.gz
jquery-9aa553aa18e79989dfa002ae5a295f626951bdf5.zip
Rework #1486 patch to avoid `try/catch` and look for hidden elements by `.offsetWidth`. Unit test currently disabled due to Chrome bug.
-rw-r--r--src/event.js26
-rw-r--r--test/unit/event.js25
2 files changed, 37 insertions, 14 deletions
diff --git a/src/event.js b/src/event.js
index fd61bca83..2b05d9a64 100644
--- a/src/event.js
+++ b/src/event.js
@@ -387,23 +387,21 @@ jQuery.event = {
// Call a native DOM method on the target with the same name name as the event.
// Can't use an .isFunction)() check here because IE6/7 fails that test.
- // IE<9 dies on focus to hidden element (#1486), may want to revisit a try/catch.
- try {
- if ( ontype && elem[ type ] ) {
- // Don't re-trigger an onFOO event when we call its FOO() method
- old = elem[ ontype ];
-
- if ( old ) {
- elem[ ontype ] = null;
- }
+ // IE<9 dies on focus to hidden element (#1486)
+ if ( ontype && elem[ type ] && elem.offsetWidth !== 0 ) {
+ // Don't re-trigger an onFOO event when we call its FOO() method
+ old = elem[ ontype ];
- jQuery.event.triggered = type;
- elem[ type ]();
+ if ( old ) {
+ elem[ ontype ] = null;
}
- } catch ( ieError ) {}
- if ( old ) {
- elem[ ontype ] = old;
+ jQuery.event.triggered = type;
+ elem[ type ]();
+
+ if ( old ) {
+ elem[ ontype ] = old;
+ }
}
jQuery.event.triggered = undefined;
diff --git a/test/unit/event.js b/test/unit/event.js
index 5bc20801a..c00eb202c 100644
--- a/test/unit/event.js
+++ b/test/unit/event.js
@@ -34,6 +34,31 @@ test("bind(),live(),delegate() with non-null,defined data", function() {
});
+/*
+Removed because Chrome 13 snaps/crashes on this 2011-09-07
+
+test("Handler changes and .trigger() order", function() {
+ expect(1);
+
+ var markup = jQuery(
+ '<div><p><b class="a">b</b></p></div>'
+ ).appendTo( "body" );
+
+ var path = "";
+ jQuery( "b" ).parents().bind( "click", function(e){
+ path += this.nodeName.toLowerCase() + " ";
+ // Should not change the event triggering order
+ $(this).parent().remove();
+ });
+
+ markup.find( "b" ).trigger( "click" );
+
+ equals( path, "p div body html ", "Delivered all events" )
+
+ markup.remove();
+});
+*/
+
test("bind(), with data", function() {
expect(4);
var handler = function(event) {
0/stable29'>backport/38630/stable29 Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
summaryrefslogtreecommitdiffstats
path: root/apps/updatenotification/l10n/en_GB.json
blob: ce10d5186254cac466c15267b2d2627f9ba516df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42