diff options
author | Patrick Simianer <p@simianer.de> | 2016-05-19 13:25:32 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2016-05-19 13:25:32 +0200 |
commit | c5750c63c6005ae022c11166ba40f62a11df487f (patch) | |
tree | eff3a8687866b6c1528b46f6d6f1296f7e1640a1 /raphael.inline_text_editing.js | |
parent | 8a5c0adf5ccd818d2924364358d8d9b45e84260b (diff) |
fixes, check align, better isOnScreen, count *
Diffstat (limited to 'raphael.inline_text_editing.js')
-rw-r--r-- | raphael.inline_text_editing.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/raphael.inline_text_editing.js b/raphael.inline_text_editing.js index db5df1e..e0a6953 100644 --- a/raphael.inline_text_editing.js +++ b/raphael.inline_text_editing.js @@ -75,7 +75,8 @@ var originalBbox = subject._getBBox(); var width = originalBbox.width; var height = originalBbox.height; - var x = container.offsetLeft + subject.attrs.x + translateX; + var x = container.offsetLeft + originalBbox.x + translateX; + x -= $("#holder").scrollLeft(); var y = container.offsetTop + subject.attrs.y - height / 2 + translateY; var sTransform = ''; var sOrigin = 'center center'; @@ -95,7 +96,6 @@ // Re-apply stored transformation to the element and hide it subject.node.setAttribute("transform", matrix); subject.hide(); - // Prepare input styles var oStyles = { position: 'absolute', @@ -144,6 +144,9 @@ this.input = document.createElement("textarea"); this.input.value = subject.attrs.text ? subject.attrs.text.replace(/\'/g,"\\\'") : ''; this.input.setAttribute("style", sStyles); + this.input.addEventListener('keypress', function () { + DE_count_kbd += 1; + }); this.input.addEventListener('keyup', this._handleKeyDown.bind(this)); |