$(ReactDOM.findDOMNode(self.refs.list)).focus().on('keydown', function(e) { var item; if (e.keyCode == 38) { //up item = modal.prev(); } else if (e.keyCode == 40) {//down item = modal.next(); } if (item) { e.shiftKey ? self.setState({}) : self.onClick(item); e.preventDefault(); } });
$(selector).click(function(e) { var isEditable = !!$(this).prop('contentEditable'); $(this).prop('contentEditable', isEditable); $(this).focus(); $(this).selectText(); });
// Click on delete icon in chip. self.$document.off('click.chips-delete', SELS.CHIPS + ' ' + SELS.DELETE).on('click.chips-delete', SELS.CHIPS + ' ' + SELS.DELETE, function(e) { var $target = $(e.target); var $chips = $target.closest(SELS.CHIPS); var $chip = $target.closest(SELS.CHIP); e.stopPropagation(); self.deleteChip($chip.index(), $chips); $chips.find('input').focus(); });
$(window).focus(() => { this.chatConversationVw && this.isConvoOpen() && this.markConvoAsRead(this.chatConversationVw.model.get('guid')); });
acc.find('.js-accordionPrev').on('click', function(){ var oldPos = accWin.css('left').replace("px", ""); if (oldPos < (0)){ accWin.css('left', function(){ return parseInt(accWin.css('left').replace("px", "")) + accWidth; }); // switch active tab var curActive = acc.find('.accordion-active'); curActive.addClass('accordion-inactive').removeClass('accordion-active'); var newActive = curActive.prev('.accordion-child'); newActive.addClass('accordion-active').removeClass('accordion-inactive'); // focus search input newActive.find('input:visible:first').focus(); } });
static uploadFile (filename) { expect(fs.existsSync(filename), "E2EAttachments.uploadFile(): file should exist: "+filename) .to.be.ok; if (! E2EAttachments.isUploadButtonVisible()) { E2EAttachments.expandAttachmentsArea(); } // Different file upload mechanisms for headless and desktop browsers if (E2EGlobal.browserIsPhantomJS()) { browser.execute(function () { $('#btnUploadAttachment').attr("style", "").focus(); // remove display:none style so that focus() works }); browser.keys(filename); // send filename as keystrokes } else { browser.chooseFile("#btnUploadAttachment", filename); } E2EGlobal.waitSomeTime(1500); }
$(data.holder).bind('click',data,function(event) { $(event.data.fake_input).focus(); });
acc.find('.js-accordionNext').on('click', function(){ var oldPos = accWin.css('left').replace("px", ""); if ($('#storeWizardForm')[0].checkValidity()) { if (oldPos > (accWidth * accNum * -1 + accWidth)) { accWin.css('left', function () { return parseInt(accWin.css('left').replace("px", "")) - accWidth; }); // switch active tab var curActive = acc.find('.accordion-active'); curActive.addClass('accordion-inactive').removeClass('accordion-active'); var newActive = curActive.next('.accordion-child'); newActive.addClass('accordion-active').removeClass('accordion-inactive'); // focus search input newActive.find('input:visible:first').focus(); } } });
$(document).ready(function(d) { $('#inputEmail').focus(); });
self.$document.off('click.chips-focus', SELS.CHIPS).on('click.chips-focus', SELS.CHIPS, function(e){ $(e.target).find(SELS.INPUT).focus(); });
$("#viewCustomerOrders").click(function () { setTimeout(function () { $("#holdCustomerOrderInput").focus(); }, 500); });
$(selector).click(function(e) { var isEditable = !!$(this).prop('contentEditable'); $(this).prop('contentEditable', isEditable); $(this).focus(); $(this).selectText(); });
$("#viewRefOrders").click(function () { setTimeout(function () { $("#holdOrderInput").focus(); }, 500); });
// Click on delete icon in chip. self.$document.off('click.chips-delete', SELS.CHIPS + ' ' + SELS.DELETE).on('click.chips-delete', SELS.CHIPS + ' ' + SELS.DELETE, function (e) { var $target = $(e.target); var $chips = $target.closest(SELS.CHIPS); var $chip = $target.closest(SELS.CHIP); e.stopPropagation(); self.deleteChip($chip.index(), $chips); $chips.find('input').focus(); });
self.$document.off('click.chips-focus', SELS.CHIPS).on('click.chips-focus', SELS.CHIPS, function (e) { $(e.target).find(SELS.INPUT).focus(); });