Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
67 lines (62 sloc) 2.05 KB
<?xml version="1.0"?>
<bindings xmlns="" xmlns:h="">
<binding id="controller">
var thisRef=this;
var loadHdlr = function() {
var i, fld;
var anon = document.getAnonymousNodes(thisRef)[0];
var flds = anon.getElementsByTagName("input"); //get text inputs
flds[flds.length] = anon.getElementsByTagName("select")[0]; //add the select field
var menu = document.getElementById(thisRef.getAttribute("title"));
if(!menu) return;
for(i=0; (fld=flds[i]); i++) {
fld.value = menu[]; // Set field to menu initial value
fld.onchange = function() { // When changed, set menu to field value:
var p = "parentNode";
var id = this[p][p][p][p][p].getAttribute("title");
if(menu) menu[] = ("edge" ? this.value : parseFloat(this.value));
if(window.addEventListener) window.addEventListener("load", loadHdlr, false); //fire after load so we can be sure the menu is fully loaded and bound
loadHdlr(); //in case doc already loaded
<table xmlns="">
<th>Edge of Window:</th>
<select name="edge">
<option value="left">left</option>
<option value="bottom">bottom</option>
<option value="right">right</option>
<option value="top">top</option>
<th>Min. Icon Size:</th>
<td><input type="text" size="3" name="iconMinSize" /> pixels</td>
<th>Max. Icon Size:</th>
<td><input type="text" size="3" name="iconMaxSize" /> pixels</td>
<th>Icon Spacing:</th>
<td><input type="text" size="3" name="iconSpacing" /> pixels</td>
<th>Scaling Curve:</th>
<td><input type="text" size="3" name="scaleReach" /> (bigger number is smoother curve)</td>
<children />