As a side improvement, adding an event listener for the `escape` key would make the AnnotationAdd dialog easier to use. See https://forum.xwiki.org/t/ability-to-move-annotation-target/18222/4