}
this.wrapper.on('keyup', function(e) {
- if(e.which >= 37 && e.which <= 40)
- canvas.setCurrentElement(canvas.getCursor().getPosition().element, {caretTo: false})
+ if(e.which >= 37 && e.which <= 40) {
+ var element = canvas.getCursor().getPosition().element,
+ caretTo = false;
+ if(!element) {
+ // Chrome hack
+ var direction;
+ if(e.which === (KEYS.ARROW_LEFT || KEYS.ARROW_DOWN)) {
+ direction = 'above';
+ caretTo = 'end';
+ } else {
+ direction = 'below';
+ caretTo = 'start';
+ }
+ element = canvas.getDocumentElement(utils.nearestInDocumentOrder('[document-text-element]', direction, window.getSelection().focusNode));
+ }
+ canvas.setCurrentElement(element, {caretTo: caretTo});
+ }
});
this.wrapper.on('keydown', function(e) {
+[document-node-element] {
+ font-size: 1px;
+}
[document-text-element] {
+ font-size: 14px;
display: inline;
margin: 0 1px;
border: 1px solid white;
min-width: 10px;
}
-[wlxml-tag=header] {
+[wlxml-tag=header] [document-text-element] {
font-size: 13px;
font-weight: bold;
margin: 10px 0;
color: blue;
}
-[wlxml-tag=header] [wlxml-class=author] {
+[wlxml-tag=header] [wlxml-class=author] [document-text-element] {
font-size: 14px;
}
-[wlxml-tag=header] [wlxml-class=title] {
+[wlxml-tag=header] [wlxml-class=title] [document-text-element] {
font-size:18px;
}