Skip to content
This repository was archived by the owner on May 20, 2023. It is now read-only.

Commit 02406bc

Browse files
cissyshinshahan
authored andcommitted
Import overlay constants instead of hardcoding strings everywhere.
PiperOrigin-RevId: 199415134
1 parent 22fbad2 commit 02406bc

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/src/laminate/popup/popup_hierarchy.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import 'dart:async';
66
import 'dart:html';
77

88
import 'package:angular/angular.dart';
9+
import 'package:angular_components/laminate/overlay/constants.dart';
910
import 'package:angular_components/utils/browser/events/events.dart' as events;
1011

1112
/// Tracks a hierarchy of visible popup and provides it closing logic.
@@ -62,8 +63,8 @@ class PopupHierarchy {
6263
// created by another app using ACX.
6364
// TODO(google): Find a way to compute it only when needed and make it
6465
// globally accessible.
65-
var modalPanes =
66-
document.querySelectorAll('.acx-overlay-container .pane.modal.visible');
66+
var modalPanes = document
67+
.querySelectorAll('.$overlayContainerClassName .pane.modal.visible');
6768
if (modalPanes.isNotEmpty) {
6869
if (useMultiModalDismissal) {
6970
// Only close popups that belong to the currently visible modal or whose

lib/src/material_tooltip/tooltip_target.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import 'dart:async';
66
import 'dart:html';
77

88
import 'package:angular/angular.dart';
9+
import 'package:angular_components/laminate/overlay/constants.dart';
910
import 'package:angular_components/laminate/popup/popup.dart';
1011
import 'package:angular_components/src/material_tooltip/tooltip_controller.dart';
1112
import 'package:angular_components/model/action/delayed_action.dart';
@@ -163,7 +164,7 @@ class ClickableTooltipTargetDirective extends TooltipBehavior
163164
// Don't hide the tooltip if focus went to an element inside the tooltip.
164165
HtmlElement el;
165166
for (el = event.relatedTarget; el.parent != null; el = el.parent) {
166-
if (el.className == "acx-overlay-container") return;
167+
if (el.className == overlayContainerClassName) return;
167168
}
168169

169170
hideTooltip(immediate: true);

0 commit comments

Comments
 (0)