public override async Task InteropEventCallback(string id, CallerName name, EventType type)
 {
     if (id == Target && name.Equals(typeof(ClickForward)) && type == EventType.Click)
     {
         await ToggleAsync();
     }
     else if ((name.Equals(typeof(BSModal)) || name.Equals(typeof(BSOffCanvas))) && type == EventType.Toggle)
     {
         await HideAsync();
     }
 }
示例#2
0
 public override async Task InteropEventCallback(string id, CallerName name, EventType type,
                                                 Dictionary <string, string>?classList = null, JavascriptEvent?e = null)
 {
     if (id == Target && name.Equals(this) && type == EventType.Mouseenter)
     {
         await ShowAsync();
     }
     else if (id == Target && name.Equals(this) && type == EventType.Mouseleave)
     {
         await HideAsync();
     }
 }
示例#3
0
 public override async Task InteropEventCallback(string id, CallerName name, EventType type)
 {
     if (id == DataId && name.Equals(typeof(ClickForward)) && type == EventType.Click)
     {
         await ToggleAsync();
     }
 }
示例#4
0
 public override async Task InteropEventCallback(string id, CallerName name, EventType type)
 {
     if (DataId == id && name.Equals(this) && type == EventType.TransitionEnd)
     {
         await TransitionEndAsync();
     }
 }
示例#5
0
        public override async Task InteropEventCallback(string id, CallerName name, EventType type,
                                                        Dictionary <string, string>?classList, JavascriptEvent?e)
        {
            // The if statement was getting hard to read so split into parts
            if (id == DataRefId && name.Equals(this) && type == EventType.Click)
            {
                // If this dropdown toggle return
                if (e?.Target.ClassList.Any(q => q.Value == "dropdown-toggle") == true &&
                    e.Target.TargetId == DataId)
                {
                    return;
                }

                // If click element is inside this dropdown return
                // if (e?.Target.ChildrenId?.Any(q => q == DataId) == true && AllowItemClick) return;
                // If is Manual Return
                if (IsManual)
                {
                    return;
                }
                await HideAsync();
            }
        }