From: Dan Vanderkam Date: Mon, 1 Jul 2013 02:43:28 +0000 (-0400) Subject: focus text box when editing annotation; can be done with callback X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=27fbc14e202a433f01f968ebcf25031624f00df4;p=dygraphs.git focus text box when editing annotation; can be done with callback --- diff --git a/tests/hairlines.html b/tests/hairlines.html index 85dafce..ad9f987 100644 --- a/tests/hairlines.html +++ b/tests/hairlines.html @@ -242,6 +242,10 @@ loadFromStorage(); } + // Set focus on text box when you edit an annotation. + $(annotations).on('beganEditAnnotation', function(e, a) { + $('input[type=text]', a.infoDiv).focus(); + }); // Demonstration of how to use various other event listeners $(hairlines).on({ @@ -265,9 +269,6 @@ 'annotationDeleted': function(e, data) { console.log('annotation deleted at ', data.series, data.xval); }, - 'beganEditAnnotation': function(e, data) { - console.log('began editing annotation at ', data.series, data.xval); - }, 'annotationEdited': function(e, data) { console.log('edited annotation at ', data.series, data.xval); },