function stopPropagation(e) { if (!$(e.target).closest('th').next('th').length) { return; } e.stopPropagation(); e.preventDefault(); }
$(document).on('mousedown', function(e) { stopDrag(); var target = $(e.target); Object.keys(dragCallbacks).some(function(selector) { dragTarget = target.closest(selector); if (dragTarget.length) { dragCallback = dragCallbacks[selector]; return true; } dragTarget = null; }); if (!dragTarget || !dragCallback) { return; } dragOffset = e; e.preventDefault(); }).on('mousemove', function(e) { if (!dragTarget) { return; } dragCallback.forEach(function(callback) { callback(dragTarget, e.clientX - dragOffset.clientX, e.clientY - dragOffset.clientY, dragOffset.clientX, dragOffset.clientY); }); dragOffset = e; }).on('mouseup', stopDrag) .on('mouseout', function(e) { !e.relatedTarget && stopDrag(); });
if (!util.isFocusEditor() && !$(e.target).closest('.w-frames-list').length) { var modal = self.props.modal; if (e.shiftKey) {
if (!util.isFocusEditor() && !$(e.target).closest('.w-frames-list').length) { self.clear();
self.componentDidUpdate(); $(document).on('mousedown click', function(e) { if ($(e.target).closest('.w-context-menu').length) { e.preventDefault(); return; }, onClick: function(e) { var target = $(e.target).closest('li'); if (target.hasClass('w-ctx-sub-menu-list') || target.hasClass('w-ctx-item-disabled')) { return;
//set custom color input values self.$el.find('.js-customizeColorInput').each(function(){ var newColor = self.model.get('page').profile[$(this).attr('id')]; $(this).val(newColor); $(this).closest('.positionWrapper').find('.js-customizeColor').css('background-color', newColor); });
self.$document.off('focusout.chips', SELS.CHIPS + ' ' + SELS.INPUT).on('focusout.chips', SELS.CHIPS + ' ' + SELS.INPUT, function (e) { var $currChips = $(e.target).closest(SELS.CHIPS); $currChips.removeClass('focus'); // Remove active if empty if ($currChips.data('chips') === undefined || !$currChips.data('chips').length) { $currChips.siblings('label').removeClass('active'); } $currChips.siblings('.prefix').removeClass('active'); });
origin.on('mouseleave', function (e) { // If hover on origin then to something other than dropdown content, then close var toEl = e.toElement || e.relatedTarget; // added browser compatibility for target element if (!$(toEl).closest('.dropdown-content').is(activates)) { activates.stop(true, true); hideDropdown(); open = false; } });
// Scroll selected options to the top this.$('.js-homeModal-listParent').find('input:checked').each(function(){ var checkedInputScrollParent = $(this).closest('ul'); var checkedInputPosition = $(this).closest('li').position().top; var checkedInputOffset = checkedInputScrollParent.position().top; checkedInputScrollParent.scrollTop(checkedInputPosition - checkedInputOffset); });
self.$document.off('click.chips-select', SELS.CHIP).on('click.chips-select', SELS.CHIP, function (e) { var $chip = $(e.target); if ($chip.length) { var wasSelected = $chip.hasClass('selected'); var $chips = $chip.closest(SELS.CHIPS); $(SELS.CHIP).removeClass('selected'); if (!wasSelected) { self.selectChip($chip.index(), $chips); } } });
self.$document.off('focusin.chips', SELS.CHIPS + ' ' + SELS.INPUT).on('focusin.chips', SELS.CHIPS + ' ' + SELS.INPUT, function(e){ var $currChips = $(e.target).closest(SELS.CHIPS); $currChips.addClass('focus'); $currChips.siblings('label, .prefix').addClass('active'); $(SELS.CHIP).removeClass('selected'); });
activates.on('mouseleave', function (e) { // Mouse out var toEl = e.toElement || e.relatedTarget; if (!$(toEl).closest('.dropdown-button').is(origin)) { activates.stop(true, true); hideDropdown(); open = false; } });