use of elemental2.dom.Event in project kie-wb-common by kiegroup.
the class DragAndDropHelper method onDragAreaMouseDown.
Object onDragAreaMouseDown(final Event e) {
final MouseEvent event = (MouseEvent) e;
if (!Objects.isNull(event.target)) {
final Element grabber = ((Element) event.target).closest(".drag-grabber");
if (Objects.isNull(grabber)) {
return this;
}
draggingElement = (HTMLElement) grabber.closest(DRAGGABLE_ITEM_CLASS);
clickedYPosition = (int) event.clientY;
startYPosition = getTop(getDragging());
}
return this;
}
use of elemental2.dom.Event in project kie-wb-common by kiegroup.
the class DNDListComponentView method onStartDrag.
void onStartDrag(final Event event) {
final HTMLElement target = (HTMLElement) event.target;
final HTMLElement parent = (HTMLElement) target.parentNode;
if (isGrip(target)) {
holdDraggingElement(parent);
}
}
use of elemental2.dom.Event in project kie-wb-common by kiegroup.
the class TimePicker method onViewElementBlur.
private Object onViewElementBlur(final Event event) {
final FocusEvent focusEvent = (FocusEvent) event;
onBlur(focusEvent, getInputBind());
return this;
}
use of elemental2.dom.Event in project kie-wb-common by kiegroup.
the class DataTypeShortcuts method keyDownListener.
void keyDownListener(final Event e) {
if (!(e instanceof KeyboardEvent)) {
return;
}
final KeyboardEvent event = (KeyboardEvent) e;
if (isNotEnabled()) {
return;
}
switch(event.key) {
case "Esc":
/* IE/Edge specific value */
case "Escape":
listShortcuts.onEscape();
return;
case "Backspace":
if (event.ctrlKey) {
listShortcuts.onCtrlBackspace();
}
return;
case "Tab":
if (isSearchBarTarget(event)) {
event.preventDefault();
listShortcuts.onTab();
}
return;
case "s":
if (event.ctrlKey) {
event.preventDefault();
listShortcuts.onCtrlS();
}
return;
case "b":
if (event.ctrlKey) {
event.preventDefault();
listShortcuts.onCtrlB();
}
return;
case "u":
if (event.ctrlKey) {
event.preventDefault();
listShortcuts.onCtrlU();
}
return;
case "d":
if (event.ctrlKey) {
event.preventDefault();
listShortcuts.onCtrlD();
}
return;
case "e":
if (event.ctrlKey) {
event.preventDefault();
listShortcuts.onCtrlE();
}
return;
}
if (isInputEvent(event) && !isSearchBarTarget(event)) {
return;
}
switch(event.key) {
case "Down":
/* IE/Edge specific value */
case "ArrowDown":
listShortcuts.onArrowDown();
return;
case "Up":
/* IE/Edge specific value */
case "ArrowUp":
listShortcuts.onArrowUp();
return;
case "Left":
/* IE/Edge specific value */
case "ArrowLeft":
listShortcuts.onArrowLeft();
return;
case "Right":
/* IE/Edge specific value */
case "ArrowRight":
listShortcuts.onArrowRight();
}
}
use of elemental2.dom.Event in project kie-wb-common by kiegroup.
the class DataTypeShortcuts method clickListener.
void clickListener(final Event event) {
if (isNotEnabled()) {
return;
}
if (tabContentContainsTarget(event) || dropdownMenuContainsTarget(event) || constraintModalFooterContainsTarget(event)) {
final Element dataTypeElement = getDataTypeRowElement(event);
if (dataTypeElement != null) {
highlight(dataTypeElement);
}
listShortcuts.focusIn();
} else {
reset();
}
}
Aggregations