private void OnMouseMove(Event evt) { var currentElement = evt.Target; if (lastElement != currentElement) { var current = currentElement; while (current != null) { var hasMouse = current.As<JsObject>().member("$hasMouse"); if (!hasMouse) FireMouseEntered(current); else break; current = current.ParentElement; } // If the new element is not contained in the last element... if (lastElement != null && !currentElement.IsDescendentOf(lastElement)) { var last = lastElement; while (last != null) { if (!last.Contains(currentElement)) FireMouseExited(last); else break; last = last.ParentElement; } } lastElement = currentElement; } }
protected virtual void OnSubmitting(Event evt) { var submitting = Submitting; if (submitting != null || SubmitLink != null) { evt.PreventDefault(); if (submitting != null) submitting(); if (SubmitLink != null) SubmitLink.FireClick(); } }
private void OnMouseOut(Event evt) { if (evt.RelatedTarget == null) { var current = lastElement; while (current != null) { FireMouseExited(lastElement); current = current.ParentElement; } } }
private void OnJsContentMouseLeave(Event arg) { if (overlay != null) overlayContainer.Style.Display = "none"; }
private void OnJsContentMouseEnter(Event arg) { if (overlay != null) overlayContainer.Style.Display = ""; }
private void OnJsContentClick(Event arg) { OnJsContentMouseLeave(arg); // Hide the dropdown when there's a click }
private void OnJsChanged(Event evt) { var changed = Changed; if (changed != null) changed(); }
private void OnMouseUp(Event evt) { isMouseDown = false; if (evt.Target != mouseDownTarget) FireMouseUp(mouseDownTarget); }
private void OnMouseDown(Event evt) { isMouseDown = true; mouseDownTarget = evt.Target; }
private async void OnWheel(Event evt) { // var wheelEvent = evt.As<WheelEvent>(); var atBottom = Browser.Window.InnerHeight + Browser.Window.ScrollY == Browser.Document.Body.ScrollHeight; if (wasAtBottom != atBottom) { wasAtBottom = atBottom; // This section resets the wasAtBottom state if the scroll bars aren't visible. This is to allow further // triggering after the delay. Otherwise, once you've gotten the first wasAtBottom change to occur, it // would never fire again. if (wasAtBottom && Browser.Window.ScrollY == 0) { await Task.Delay(3000); wasAtBottom = false; } if (wasAtBottom && MvcApplication.Instance.View != null) { MvcApplication.Instance.NotifyOnBottomBounced(); } } }
private void LocalHrefClick(Event evt) { evt.PreventDefault(); ViewContext.ControllerContext.Application.Open(Node.GetAttribute("href")); }
public extern bool DispatchEvent(Event evt);