replace edits view with text
This commit is contained in:
parent
9c967c7ac4
commit
274a8ffcca
1 changed files with 29 additions and 32 deletions
|
@ -359,38 +359,35 @@ pandora.ui.editPanel = function(isEmbed) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderEdits() {
|
function renderEdits() {
|
||||||
that = Ox.IconList({
|
that.css({
|
||||||
borderRadius: 16,
|
'overflow-y': 'auto'
|
||||||
defaultRatio: 1,
|
});
|
||||||
draggable: true,
|
var $content = Ox.Element()
|
||||||
item: function(data, sort, size) {
|
.css({padding: '16px'})
|
||||||
size = size || 128;
|
.appendTo(that),
|
||||||
var ui = pandora.user.ui,
|
isEditable = pandora.site.capabilities.canEditSitePages[pandora.user.level];
|
||||||
url = pandora.getMediaURL('/edit/' + data.id + '/icon' + size + '.jpg?' + data.modified),
|
pandora.api.getPage({name: 'edits'}, function(result) {
|
||||||
info = Ox.formatDuration(data.duration);
|
Ox.EditableContent({
|
||||||
return {
|
clickLink: pandora.clickLink,
|
||||||
height: size,
|
editable: isEditable,
|
||||||
id: data.id,
|
tooltip: isEditable ? pandora.getEditTooltip() : '',
|
||||||
title: data.name,
|
type: 'textarea',
|
||||||
info: info,
|
placeholder: isEditable ? Ox._('Doubleclick to insert text') : '',
|
||||||
url: url,
|
value: result.data.text
|
||||||
width: size,
|
})
|
||||||
};
|
.css({
|
||||||
},
|
width: '100%'
|
||||||
items: function(data, callback) {
|
})
|
||||||
pandora.api.findEdits(data, callback);
|
.bindEvent({
|
||||||
return Ox.clone(data, true);
|
submit: function(data) {
|
||||||
},
|
Ox.Request.clearCache('getPage');
|
||||||
keys: ['id', 'modified', 'name', 'duration'],
|
pandora.api.editPage({
|
||||||
size: 128,
|
name: 'edits',
|
||||||
sort: [{key: 'id', operator: '+'}],
|
text: data.value
|
||||||
unique: 'id'
|
});
|
||||||
})
|
}
|
||||||
.addClass('OxMedia')
|
})
|
||||||
.bindEvent({
|
.appendTo($content);
|
||||||
open: function(data) {
|
|
||||||
pandora.UI.set('edit', data.ids[0]);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue