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' float: 'right'
}) })
: Ox.Button({ : Ox.FormElementGroup({
style: 'squared', elements: [
title: Ox._('Read Book'), Ox.Button({
width: 128 style: 'squared',
}) title: Ox._('Read Book'),
.bindEvent({ width: 112
click: function() { })
oml.UI.set({itemView: 'book'}); .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; return $element;
} }
function renderOpenButton() { function renderShareButton() {
return Ox.Button({ return Ox.Checkbox({
style: 'squared', style: 'squared',
title: Ox._('Open Folder'), title: Ox._('Share Metadata'),
width: 128 value: false,
width: 128,
}) })
.css({marginTop: '8px'}) .css({marginTop: '8px'})
.bindEvent({ .bindEvent({
click: function() { change: function(data) {
oml.api.openFolder({id: oml.user.ui.item}); // ...
} }
}); });
} }
@ -734,7 +764,7 @@ oml.ui.infoView = function(externalData, isMixed) {
}); });
if (data.mediastate == 'available') { if (data.mediastate == 'available') {
renderOpenButton().appendTo($data); renderShareButton().appendTo($data);
} }
$('<div>').css({height: '16px'}).appendTo($data); $('<div>').css({height: '16px'}).appendTo($data);