Search Results

Search found 1 results on 1 pages for 'mozgras'.

Page 1/1 | 1 

  • Twitter's Bootstrap 2.x popover callback can't focus on element

    - by mozgras
    I've modified bootstrap's popover function to include a callback which works great. But in the callback I cannot programmatically focus on the first form field. Strange, because I can manipulate other elements in the callback function as well as focus on the element at other points. Here's the code to add a callback which I got from another SO question (http://stackoverflow.com/a/14727204/1596547): var tmp = $.fn.popover.Constructor.prototype.show; $.fn.popover.Constructor.prototype.show = function () { tmp.call(this); if (this.options.callback) { this.options.callback(); } } Here's the popover code: $('#a-editor-btn').popover({ html: true, placement: 'bottom', callback: function(){ $('#a-form-point').focus(); //nothing happens console.log('hello'); // works . . }, content: $('#a-form').html() }).parent().delegate('button#insert-point-btn', 'click', function() { insertPoint(); }).delegate('.a-form','keypress', function(e) { if ( e.which == 13 ) { insertPoint(); } });

    Read the article

1