}
FluidbookResize.prototype = {
- init: function() {
+ init: function () {
var left = this.fluidbook.l10n.dir == 'ltr' ? '0%' : '100%';
var right = this.fluidbook.l10n.dir == 'ltr' ? '100%' : '0%';
origin: [left, '50%']
});
},
- resize: function(init) {
+ resize: function (init) {
if (init == undefined || init == null) {
init = false;
}
if (timeout > 0) {
$("#next,#previous").hide();
clearTimeout(this.navresizeTimeout);
- this.navresizeTimeout = setTimeout(function() {
+ this.navresizeTimeout = setTimeout(function () {
$this.resizeNav(interfaceScale)
}, timeout);
} else {
$("#main").show();
},
- resizeNav: function(interfaceScale) {
+ resizeNav: function (interfaceScale) {
var topNext = (this.hh - 100 * interfaceScale) / 2;
$("#next,#previous").css({
top: topNext
});
$("#next,#previous").show();
},
- resizePopupVideos: function() {
+ resizePopupVideos: function () {
var maxh = this.hh - 80;
- $(".mview .videoContainer video").each(function() {
+ $(".mview .videoContainer video").each(function () {
var w = $(window).width() - 40;
var ratio = parseInt($(this).attr('data-width')) / parseInt($(this).attr('data-height'));
var h = w / ratio;
+ if (isNaN(h)) {
+ h = maxh;
+ }
$(this).css({
height: h,
maxHeight: maxh
});
});
},
- resizePopupAudios: function() {
- $(".mview audio").each(function() {
+ resizePopupAudios: function () {
+ $(".mview audio").each(function () {
var w = $(window).width() - 200;
var h = 30;
$(this).css({
});
});
},
- resizeSplash: function() {
+ resizeSplash: function () {
if ($("#splash").length == 0) {
return;
}
left: (this.ww - lw) / 2
});
},
- updateWindow: function() {
+ updateWindow: function () {
this.ww = $(window).width();
this.hh = $(window).height();
},
- resizeView: function() {
+ resizeView: function () {
var $this = this;
this.updateWindow();
});
- $(".mview .caption h2").each(function() {
+ $(".mview .caption h2").each(function () {
var wavailable = $this.ww;
- $(this).parent().find('a.back').each(function() {
+ $(this).parent().find('a.back').each(function () {
wavailable -= ($(this).outerWidth() + 10) * 2;
});
$(this).css('max-width', wavailable);
$("#archivesview .links").transform({scale: [ratio]});
}
- $(".bookmarkView").each(function() {
+ $(".bookmarkView").each(function () {
var w = $(this).parent().width();
var perCol = Math.floor(w / 120);
})
});
},
- handleOrientation: function() {
+ handleOrientation: function () {
var changeOrientation = this.orientation != '';
var o = this.fluidbook.support.getOrientation();
var newo;