added autoresize option and updated documentation
This commit is contained in:
parent
e8a0bfe5be
commit
2edf130472
4 changed files with 25 additions and 14 deletions
16
js/uhr.js
16
js/uhr.js
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue