only open available books
This commit is contained in:
parent
19292fb940
commit
9a6278bb83
1 changed files with 11 additions and 7 deletions
|
@ -18,6 +18,8 @@ oml.ui.viewer = function() {
|
||||||
that.updateElement = function() {
|
that.updateElement = function() {
|
||||||
item = ui.item;
|
item = ui.item;
|
||||||
if (item) {
|
if (item) {
|
||||||
|
oml.api.get({id: item, keys: ['mediastate']}, function(result) {
|
||||||
|
if (result.data.mediastate == 'available') {
|
||||||
$iframe = $iframe || Ox.Element('<iframe>').css({
|
$iframe = $iframe || Ox.Element('<iframe>').css({
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: '100%',
|
height: '100%',
|
||||||
|
@ -27,6 +29,8 @@ oml.ui.viewer = function() {
|
||||||
src: '/' + item + '/reader/'
|
src: '/' + item + '/reader/'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue