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