1
0
Fork 0
forked from 0x2620/oxjs

update Ox.URL

This commit is contained in:
rlx 2012-01-06 17:28:53 +05:30
commit dc4a8bf464
3 changed files with 38 additions and 41 deletions

View file

@ -82,6 +82,7 @@ Ox.AnnotationPanel = function(options, self) {
self.$annotations = Ox.ArrayEditable({
editable: self.options.editable,
items: getAnnotations(),
selected: self.options.selected,
sort: self.sort,
width: self.options.width,
type: self.options.type == 'text' ? 'textarea' : 'input'
@ -104,20 +105,16 @@ Ox.AnnotationPanel = function(options, self) {
}
self.$annotations.appendTo(that.$content);
/*
self.$annotations = Ox.Element()
.appendTo(that.$content);
self.$annotation = [];
self.options.items.forEach(function(item, i) {
self.$annotation[i] = Ox.Element()
.addClass('OxAnnotation')
.html(item.value.replace(/\n/g, '<br/>'))
.click(function() {
clickAnnotation(i);
})
.appendTo(self.$annotations);
});
*/
Ox.print('SOS', self.options.selected);
self.options.selected && setTimeout(function() {
selectAnnotation({id: self.options.selected});
}, 0);
function editAnnotation(data) {
var item = Ox.getObjectById(self.options.items, data.id);
item.value = data.value;
that.triggerEvent('submit', item);
}
function getAnnotations() {
return self.options.items.filter(function(item) {
@ -128,7 +125,7 @@ Ox.AnnotationPanel = function(options, self) {
) || (
self.options.range == 'position'
&& item['in'] <= self.options.position
&& item.out > self.options.position
&& item.out >= self.options.position
)
});
}
@ -144,12 +141,6 @@ Ox.AnnotationPanel = function(options, self) {
} : {}));
}
function editAnnotation(data) {
var item = Ox.getObjectById(self.options.items, data.id);
item.value = data.value;
that.triggerEvent('submit', item);
}
function togglePanel() {
}