From 27fbc14e202a433f01f968ebcf25031624f00df4 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Sun, 30 Jun 2013 22:43:28 -0400 Subject: [PATCH] focus text box when editing annotation; can be done with callback --- tests/hairlines.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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); }, -- 2.7.4