forked from 0x2620/oxjs
fix some bugs in insert html dialog
This commit is contained in:
parent
e1d8e2aeea
commit
7d4fd8f706
2 changed files with 33 additions and 8 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue