# HG changeset patch # User hamidouk # Date 1320227914 -3600 # Node ID 5150ae56e0a6dc8c800513fdb2abd2d8ddc01a6d # Parent 427632a324d50ebda68c68413bb68cc701e2a626 added two new config values for a widget : heightmax and widthmax. diff -r 427632a324d5 -r 5150ae56e0a6 src/js/widgets.js --- a/src/js/widgets.js Fri Oct 28 17:28:15 2011 +0200 +++ b/src/js/widgets.js Wed Nov 02 10:58:34 2011 +0100 @@ -20,11 +20,17 @@ this.width = config.width; } - if (config.hasOwnProperty("height")) { - // this.width and not this._width because we consider it public. + if (config.hasOwnProperty("height")) { this.height = config.height; } + if (config.hasOwnProperty("heightmax")) { + this.heightmax = config.heightmax; + } + + if (config.hasOwnProperty("widthmax")) { + this.widthmax = config.widthmax; + } }; diff -r 427632a324d5 -r 5150ae56e0a6 unittests/tests/widget.js --- a/unittests/tests/widget.js Fri Oct 28 17:28:15 2011 +0200 +++ b/unittests/tests/widget.js Wed Nov 02 10:58:34 2011 +0100 @@ -17,5 +17,13 @@ }); + test("test initialisation with more values", function() { + var config = { container: "mydiv", widthmax: 640, heightmax: 480}; + var wid = new IriSP.Widget(this.Popcorn, config, this.ser); + deepEqual(wid._config, config, "Check if the parent div is set correctly"); + ok(wid.selector, "Check if the jquery selector is set"); + + }); + }; \ No newline at end of file