function stopPropagation(e) { if (!$(e.target).closest('th').next('th').length) { return; } e.stopPropagation(); e.preventDefault(); }
function hasSelector(selector) { return document.querySelector ? document.querySelector(selector) : $(selector).length; }
return; if ($('.w-files-dialog.in').length) { return events.trigger('uploadFile', file); var target = $(e.target); if (name === 'network') { if (target.closest('.w-frames-composer').length) { return; data.append('importSessions', files[0]); self.uploadSessionsForm(data); } if (target.closest('.w-divider-left').length) { if (name === 'rules') { data = new FormData();
if (!util.isFocusEditor() && !$(e.target).closest('.w-frames-list').length) { var modal = self.props.modal; if (e.shiftKey) {
self.componentDidUpdate(); $(document).on('mousedown click', function(e) { if ($(e.target).closest('.w-context-menu').length) { e.preventDefault(); return;
function getParent($this) { var selector = $this.attr('data-target') if (!selector) { selector = $this.attr('href') selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 } var $parent = selector && $(selector) return $parent && $parent.length ? $parent : $this.parent() }
export function closeModal() { const modal = $(".modal.show"); if (modal.length > 0) { modal.modal("hide"); } }
QUnit.test('should add aria-describedby to the trigger on show', function (assert) { assert.expect(3) var $trigger = $('<a href="#" rel="tooltip" title="Another tooltip"/>') .bootstrapTooltip() .appendTo('#qunit-fixture') .bootstrapTooltip('show') var id = $('.tooltip').attr('id') assert.strictEqual($('#' + id).length, 1, 'has a unique id') assert.strictEqual($('.tooltip').attr('aria-describedby'), $trigger.attr('id'), 'tooltip id and aria-describedby on trigger match') assert.ok($trigger[0].hasAttribute('aria-describedby'), 'trigger has aria-describedby') })
append (what, raw) { var id = 'panic' + this.hash (what) var counter = $('#' + id + ' .panic-alert-counter') if (counter.length) { counter.text ((counter.text () || '1').parsedInt + 1) } else { $('<div class="panic-alert-error">').attr ('id', id) .append ('<span class="panic-alert-counter">') .append (this.print (what, raw)) .insertAfter (this.el.find ('.panic-modal-title')) } this.toggleVisibility (true) this.layout () }
$this.on('sliderStart', function() { clearInterval($interval); $interval = setInterval( function(){ $active_index = $slider.find('.active').index(); if ($slides.length == $active_index + 1) $active_index = 0; // loop to start else $active_index += 1; moveToSlide($active_index); }, options.transition + options.interval ); });
scrollToElement(selector) { const $element = $(selector); if ($element.length > 0) { const bodyTopPadding = parseInt($('body').css('padding-top'), 10); window.scroll(0, $element.offset().top - bodyTopPadding); } }
// Toggles the empty state function toggleEmptyState(state) { if(typeof state === 'undefined') state = $('#nav-items .nav-item').length === 0; $('#empty').prop('hidden', !state); $('#nav-items').prop('hidden', state); }
function getParent($this) { var selector = $this.attr('data-target') if (!selector) { selector = $this.attr('href') selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 } var $parent = selector && $(selector) return $parent && $parent.length ? $parent : $this.parent() }
function getParent($this) { var selector = $this.attr('data-target') if (!selector) { selector = $this.attr('href') selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 } var $parent = selector && $(selector) return $parent && $parent.length ? $parent : $this.parent() }