From c533db985504eaacdedfd337ae0aafff8368bf9f Mon Sep 17 00:00:00 2001 From: Shrulik Date: Thu, 12 Nov 2015 16:17:40 +0200 Subject: [PATCH 1/2] Updated tooltip documentation for breaking change in 0.13.4 with custom events I'm guessing the same is true for the Popover --- src/tooltip/docs/readme.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/tooltip/docs/readme.md b/src/tooltip/docs/readme.md index 5e91c96f3a..d4f0501aa0 100644 --- a/src/tooltip/docs/readme.md +++ b/src/tooltip/docs/readme.md @@ -72,6 +72,15 @@ methods are available: appendToBody: false + +**Using Custom Events** + +When adding custom events with $uibTooltipProvider.setTriggers(eventsMap), the only way to trigger those events is with ```domElement.dispatchEvent(new Event('customEvent'))```. Note the DOM element. From an angular $element, you would use $element[0]. + +Why ? This is because custom events thrown by jQuery.trigger do not use the native implementation of events, so you can't listen to them with domElement.addEventListener, which ui-bootstrap uses. [Details](https://github.com/angular-ui/bootstrap/pull/4322) + + + **Known issues** For Safari 7+ support, if you want to use the **focus** `tooltip-trigger`, you need to use an anchor tag with a tab index. For example: From b1cb87302e73e4bdf6a9be0e4b6c41836ec7b7c6 Mon Sep 17 00:00:00 2001 From: Shrulik Date: Wed, 16 Dec 2015 16:57:29 +0200 Subject: [PATCH 2/2] Added IE 9-11 support to the explanation. --- src/tooltip/docs/readme.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tooltip/docs/readme.md b/src/tooltip/docs/readme.md index d4f0501aa0..7003acc285 100644 --- a/src/tooltip/docs/readme.md +++ b/src/tooltip/docs/readme.md @@ -75,14 +75,16 @@ methods are available: **Using Custom Events** -When adding custom events with $uibTooltipProvider.setTriggers(eventsMap), the only way to trigger those events is with ```domElement.dispatchEvent(new Event('customEvent'))```. Note the DOM element. From an angular $element, you would use $element[0]. +When adding custom events with $uibTooltipProvider.setTriggers(eventsMap), the way to trigger those events is with ```domElement.dispatchEvent(new CustomEvent('customEventName'))```. Note the DOM element. From an angular $element, you would use $element[0]. Why ? This is because custom events thrown by jQuery.trigger do not use the native implementation of events, so you can't listen to them with domElement.addEventListener, which ui-bootstrap uses. [Details](https://github.com/angular-ui/bootstrap/pull/4322) - **Known issues** +For IE 9-11 support, if you want to use the constructor form above, you would need a Custom Events polyfill, such as this : +https://github.com/krambuhl/custom-event-polyfill. + For Safari 7+ support, if you want to use the **focus** `tooltip-trigger`, you need to use an anchor tag with a tab index. For example: ```