Open Media Library
This commit is contained in:
commit
2ee2bc178a
228 changed files with 85988 additions and 0 deletions
35
static/js/viewer.js
Normal file
35
static/js/viewer.js
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
'use strict';
|
||||
|
||||
oml.ui.viewer = function() {
|
||||
|
||||
var ui = oml.user.ui,
|
||||
|
||||
that = Ox.Element()
|
||||
.bindEvent({
|
||||
oml_item: function(data) {
|
||||
that.update();
|
||||
},
|
||||
oml_itemview: function(data) {
|
||||
that.update();
|
||||
}
|
||||
}),
|
||||
|
||||
$iframe;
|
||||
|
||||
that.update = function() {
|
||||
if (ui.item && ui.itemView == 'book') {
|
||||
$iframe = $iframe || Ox.Element('<iframe>').css({
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
border: 0
|
||||
}).appendTo(that);
|
||||
$iframe.attr({
|
||||
src: '/' + ui.item + '/reader/'
|
||||
});
|
||||
}
|
||||
return that;
|
||||
};
|
||||
|
||||
return that.update();
|
||||
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue