focus text box when editing annotation; can be done with callback
authorDan Vanderkam <danvdk@gmail.com>
Mon, 1 Jul 2013 02:43:28 +0000 (22:43 -0400)
committerDan Vanderkam <danvdk@gmail.com>
Mon, 1 Jul 2013 02:43:28 +0000 (22:43 -0400)
tests/hairlines.html

index 85dafce..ad9f987 100644 (file)
         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({
         '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);
         },