added autoresize option and updated documentation

This commit is contained in:
Manuel Friedli 2014-08-12 19:19:37 +02:00
parent e8a0bfe5be
commit 2edf130472
4 changed files with 25 additions and 14 deletions

View file

@ -259,6 +259,19 @@
themeChooser.val(selectedTheme);
this.options.theme = "";
this.theme(selectedTheme);
if (this.options.autoresize) {
$(window).on('resize', function () {
var $e = this.element;
var $parent = $e.parent();
var $window = $(window);
var parentWidth = $parent.width();
var parentHeight = $parent.height();
var windowWidth = $window.width();
var windowHeight = $window.height();
var size = Math.min(parentWidth, parentHeight, windowWidth, windowHeight) + 'px';
setWidth.bind(this)(size);
}.bind(this));
}
};
var setCookie = function setCookie(cookieName, cookieValue) {
var options = {};
@ -358,7 +371,8 @@
theme: uhrGlobals.themes[0].styleClass,
force: false,
controls: true,
cookiePath: undefined
cookiePath: undefined,
autoresize: true
},
"start": start,
"stop": stop,