update info view buttons

This commit is contained in:
rlx 2016-01-18 16:21:07 +05:30
parent ae6a3bd6d9
commit 6dfa62681a

View file

@ -253,29 +253,59 @@ oml.ui.infoView = function(externalData, isMixed) {
],
float: 'right'
})
: Ox.Button({
style: 'squared',
title: Ox._('Read Book'),
width: 128
})
.bindEvent({
click: function() {
oml.UI.set({itemView: 'book'});
}
: Ox.FormElementGroup({
elements: [
Ox.Button({
style: 'squared',
title: Ox._('Read Book'),
width: 112
})
.bindEvent({
click: function() {
oml.UI.set({itemView: 'book'});
}
}),
Ox.MenuButton({
items: [
{id: 'read', title: Ox._('Read in Open Media Libary')},
{id: 'open', title: Ox._('Open in External Reader')},
{},
{id: 'show', title: Ox._('Show File')}
],
overlap: 'left',
style: 'squared',
title: 'select',
tooltip: Ox._('Download Book to a List'),
type: 'image'
})
.bindEvent({
click: function(data_) {
if (data_.id == 'read') {
oml.UI.set({itemView: 'book'});
} else if (data_.id == 'open') {
// ...
} else {
oml.api.openFolder({id: oml.user.ui.item});
}
}
})
],
float: 'right'
});
return $element;
}
function renderOpenButton() {
return Ox.Button({
function renderShareButton() {
return Ox.Checkbox({
style: 'squared',
title: Ox._('Open Folder'),
width: 128
title: Ox._('Share Metadata'),
value: false,
width: 128,
})
.css({marginTop: '8px'})
.bindEvent({
click: function() {
oml.api.openFolder({id: oml.user.ui.item});
change: function(data) {
// ...
}
});
}
@ -734,7 +764,7 @@ oml.ui.infoView = function(externalData, isMixed) {
});
if (data.mediastate == 'available') {
renderOpenButton().appendTo($data);
renderShareButton().appendTo($data);
}
$('<div>').css({height: '16px'}).appendTo($data);