1
0
Fork 0
forked from 0x2620/oxjs

fix some bugs in insert html dialog

This commit is contained in:
rlx 2012-02-16 18:04:25 +00:00
commit 7d4fd8f706
2 changed files with 33 additions and 8 deletions

View file

@ -258,6 +258,7 @@ Ox.AnnotationPanel = function(options, self) {
}
function insert(data) {
Ox.print('insert', data);
var id = data.id;
Ox.InsertHTMLDialog(Ox.extend({
callback: function(data) {
@ -334,7 +335,16 @@ Ox.AnnotationPanel = function(options, self) {
} else if (data.id == 'findannotations') {
that.triggerEvent('findannotations', {key: key, value: value});
} else if (data.id == 'insert') {
insert({});
var id = $('.OxEditableElement div.OxInput').data('oxid'),
element = $('.OxEditableElement textarea.OxInput')[0];
insert({
end: element.selectionEnd,
id: id,
selection: element.value
.substr(element.selectionStart, element.selectionEnd),
start: element.selectionStart,
value: element.value
});
} else if (data.id == 'manage') {
that.triggerEvent('define', {
id: self.options.selected,