+
+ 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);
+ }
+ // already focues
+ }
+ else { // nothing was focused
+ this.focusAnnotation($origin);
+ }
+ }
+ else { // this item is not focusable
+ if(this.currentFocused) this.unfocusAnnotation();
+ }
+
+ $($box[0].offsetParent).append($overlay);
+ $origin.data('edit-overlay', $overlay);
+
+ this.currentOpen = $origin;
+ $origin.attr('x-open', 'open');
+ }
+ catch(e) {
+ console.log("Can't open", e);
+ }
+
+ return false;
+ },
+
+ addTheme: function()
+ {
+ var selection = window.getSelection();
+ var n = selection.rangeCount;
+
+ console.log("Range count:", n);
+
+ if(n == 0)
+ window.alert("Nie zaznaczono żadnego obszaru");