Attempt to fix nicFloatingPanel positioning, focus before command (for example fixes table insertion)

master
vitalif 2015-06-16 13:04:10 +00:00 committed by Vitaliy Filippov
parent 71b44059e8
commit 0d51194b6a
1 changed files with 8 additions and 1 deletions

View File

@ -618,6 +618,7 @@ var nicEditorInstance = bkClass.extend({
}, },
nicCommand : function(cmd,args) { nicCommand : function(cmd,args) {
this.elm.focus();
document.execCommand(cmd,false,args); document.execCommand(cmd,false,args);
} }
}); });
@ -1581,7 +1582,13 @@ nicEditor = nicEditor.extend({
if(top < d) { if(top < d) {
top = d; top = d;
} }
this.floating.setStyle({ top: top+'px', left: e.offsetLeft+'px' }); var x = 0;
var c = e;
while (c && c != document.body) {
x += c.offsetLeft;
c = c.offsetParent;
}
this.floating.setStyle({ top: top+'px', left: x+'px' });
}, },
hide: function() { hide: function() {