- $overlay.css({position: 'absolute', height: h, left: x, top: y, width: '95%'});
- $($origin[0].offsetParent).append($overlay);
- $origin.data('edit-overlay', $overlay);
-
- this.model.getXMLPart($origin, function(path, data) {
- $('textarea', $overlay).val(data);
- });
-
- if($origin.is("*[x-annotation-box]"))
- {
- var $b = $origin.parent();
- if(this.currentFocused) {
- // if some other is focused
- if($b[0] != this.currentFocused[0]) {
- this.unfocusAnnotation();
- this.focusAnnotation($b);
- }
+ $overlay.css({
+ position: 'absolute',
+ height: h,
+ left: x,
+ top: y,
+ width: '95%'
+ });
+
+ try {
+ $('textarea', $overlay).val( this.model.asWLML($origin[0]) );
+
+ if($origin.is(".annotation-inline-box"))
+ {
+ if(this.currentFocused) {
+ // if some other is focused
+ if($origin[0] != this.currentFocused[0]) {
+ this.unfocusAnnotation();
+ this.focusAnnotation($origin);
+ }