'modules/documentCanvas/canvas/documentElement',
'modules/documentCanvas/canvas/keyboard',
'modules/documentCanvas/canvas/utils',
'modules/documentCanvas/canvas/wlxmlListener'
'modules/documentCanvas/canvas/documentElement',
'modules/documentCanvas/canvas/keyboard',
'modules/documentCanvas/canvas/utils',
'modules/documentCanvas/canvas/wlxmlListener'
-], function($, _, Backbone, documentElement, keyboard, utils, wlxmlListener) {
+], function($, _, Backbone, logging, documentElement, keyboard, utils, wlxmlListener) {
var TextHandler = function(canvas) {this.canvas = canvas; this.buffer = null;};
$.extend(TextHandler.prototype, {
var TextHandler = function(canvas) {this.canvas = canvas; this.buffer = null;};
$.extend(TextHandler.prototype, {
this.wrapper.on('click', '[document-node-element], [document-text-element]', function(e) {
e.stopPropagation();
this.wrapper.on('click', '[document-node-element], [document-text-element]', function(e) {
e.stopPropagation();
- canvas.setCurrentElement(canvas.getDocumentElement(e.currentTarget), {caretTo: false});
+ if(e.originalEvent.detail === 3) {
+ e.preventDefault();
+ canvas._moveCaretToTextElement(canvas.getDocumentElement(e.currentTarget), 'whole');
+ } else {
+ if(mouseDown === e.target) {
+ canvas.setCurrentElement(canvas.getDocumentElement(e.currentTarget), {caretTo: false});
+ }
+ }
canvas._moveCaretToTextElement(canvas.getDocumentElement(mutation.target), 'end');
}
observer.observe(canvas.wrapper[0], config);
canvas._moveCaretToTextElement(canvas.getDocumentElement(mutation.target), 'end');
}
observer.observe(canvas.wrapper[0], config);
var textElement = canvas.getDocumentElement(mutation.target),
toSet = mutation.target.data !== utils.unicode.ZWS ? mutation.target.data : '';
var textElement = canvas.getDocumentElement(mutation.target),
toSet = mutation.target.data !== utils.unicode.ZWS ? mutation.target.data : '';
setCurrentElement: function(element, params) {
if(!(element instanceof documentElement.DocumentElement)) {
element = utils.findCanvasElement(element);
}
setCurrentElement: function(element, params) {
if(!(element instanceof documentElement.DocumentElement)) {
element = utils.findCanvasElement(element);
}
params = _.extend({caretTo: 'end'}, params);
var findFirstDirectTextChild = function(e, nodeToLand) {
var byBrowser = this.getCursor().getPosition().element;
params = _.extend({caretTo: 'end'}, params);
var findFirstDirectTextChild = function(e, nodeToLand) {
var byBrowser = this.getCursor().getPosition().element;
} else {
this.wrapper.find('.current-node-element').removeClass('current-node-element');
element._container().addClass('current-node-element');
} else {
this.wrapper.find('.current-node-element').removeClass('current-node-element');
element._container().addClass('current-node-element');