Beispiel #1
0
        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;
            }
        }
Beispiel #2
0
 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();
     }
 }
Beispiel #3
0
 private void OnMouseOut(Event evt)
 {
     if (evt.RelatedTarget == null)
     {
         var current = lastElement;
         while (current != null)
         {
             FireMouseExited(lastElement);                
             current = current.ParentElement;
         }
     }
 }
Beispiel #4
0
 private void OnJsContentMouseLeave(Event arg)
 {
     if (overlay != null)
         overlayContainer.Style.Display = "none";
 }
Beispiel #5
0
 private void OnJsContentMouseEnter(Event arg)
 {
     if (overlay != null)
         overlayContainer.Style.Display = "";
 }
Beispiel #6
0
 private void OnJsContentClick(Event arg)
 {
     OnJsContentMouseLeave(arg);     // Hide the dropdown when there's a click
 }
Beispiel #7
0
 private void OnJsChanged(Event evt)
 {
     var changed = Changed;
     if (changed != null)
         changed();
 }
Beispiel #8
0
 private void OnMouseUp(Event evt)
 {
     isMouseDown = false;
     if (evt.Target != mouseDownTarget)
         FireMouseUp(mouseDownTarget);
 }
Beispiel #9
0
 private void OnMouseDown(Event evt)
 {
     isMouseDown = true;
     mouseDownTarget = evt.Target;
 }
Beispiel #10
0
        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();
                }
            }
        }
Beispiel #11
0
 private void LocalHrefClick(Event evt)
 {
     evt.PreventDefault();
     ViewContext.ControllerContext.Application.Open(Node.GetAttribute("href"));
 }
Beispiel #12
0
 public extern bool DispatchEvent(Event evt);