Like now I'm inserting two pictures,
No matter which picture I click, the scroll bar inside will top up.
Originally thought that there will be a solution, a search results did not, and then think about the official website to check, but nothing, think of the official website to submit this bug, the results have no place to submit.
How to solve, if only to solve this bug, to study the source code, I feel is thankless.
Then I go straight from the click, MouseDown these two events, find them to get the height of the place, and then feel the words are console.log under, see is not. And then we found it.
In this function.
Pos:function () {
var = this, node = self[0], x = 0, y = 0;
if (node) {
if (node.getboundingclientrect) {
var box = Node.getboundingclientrect (),
pos = _getscrollpos (Self.doc);
x = Box.left + pos.x;
y = box.top + pos.y;
} else {
while (node) {
x + = Node.offsetleft;
Y + = Node.offsettop;
node = node.offsetparent;
}
}
}
return {x: _round (x), Y: _round (y)};
},
The main is that box.top here, do not know why, other calls when it is not a problem, that is, click on the picture when it becomes negative, it is estimated that it is to obtain an IMG from the height of the document, rather than the current mouse click where the height of the document, or other.
So I'm going to determine if Box.top is >0 before I get Y, and then it's equal to 0. However, it has no effect. namely: box.top= box.top<0? 0:box.top;
No, I'll just go straight to Y=box.top + pos.y, y = (parseint (box.top) < 0? 0:box.top) +pos.y;
This bug was resolved, but I don't know where the problem is. So when you change it, please test it more. Anyway, I did not find the problem of the place, there are, remember to remind Oh. Thank you.
About the top of the scroll bar when you click a picture in Kindeditor