static void HandleModalTrigger(DOMEventArgs evt) { HideAllModals(); using (var target = evt.EventObject.Target.ConvertTo <HTMLElement>()) { var modalId = $"{target.GetAttribute("data-modal")}-modal"; Document.GetElementById(modalId).ClassList.Add("is-shown"); } }
static void HandleSectionTrigger(DOMEventArgs evt) { HideAllSectionsAndDeselectButtons(); using (var target = evt.EventObject.Target.ConvertTo <HTMLElement>()) { // Highlight clicked button and show view target.ClassList.Add("is-selected"); // Display the current section var sectionId = $"{target.GetAttribute("data-section")}-section"; Document.GetElementById(sectionId)?.ClassList.Add("is-shown"); // Save currently active button in localStorage var buttonId = target.Id; // save this off in a cookie somewhere //cookie.settings.set('activeSectionButtonId', buttonId) } }
public virtual void OpeningItem(IWebDriver wd, Logger logger) { var eventArgs = new DOMEventArgs(wd, logger); OnOpeningItem(this, eventArgs); if (eventArgs.ShouldCancelNavigation) { return; } var link = wd.FirstOrDefault(By.CssSelector(this.LocationCriteria)); if (link == null || !link.IsDisplayed()) { logger.Info("Couldn't find Element to Engage Alternate Activity for: {0}", Key); return; } link.Click(); }
static void Button_OnClick(JSObject sender, DOMEventArgs args) { var button = (HTMLButtonElement)sender; //button.TextContent = "Clicked"; }
public virtual void ClosingItem(IWebDriver wd, Logger logger) { var eventArgs = new DOMEventArgs(wd, logger); OnClosingItem(this, eventArgs); }