[fusion-commits] r1996 - sandbox/jxlib-3.0/lib
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Fri Nov 27 11:22:18 EST 2009
Author: pagameba
Date: 2009-11-27 11:22:16 -0500 (Fri, 27 Nov 2009)
New Revision: 1996
Modified:
sandbox/jxlib-3.0/lib/jxlib.uncompressed.js
Log:
updating jxlib.
Modified: sandbox/jxlib-3.0/lib/jxlib.uncompressed.js
===================================================================
--- sandbox/jxlib-3.0/lib/jxlib.uncompressed.js 2009-11-27 02:21:28 UTC (rev 1995)
+++ sandbox/jxlib-3.0/lib/jxlib.uncompressed.js 2009-11-27 16:22:16 UTC (rev 1996)
@@ -21366,7 +21366,7 @@
}
});
-// $Id: combo.js 626 2009-11-20 13:22:22Z pagameba $
+// $Id: combo.js 647 2009-11-26 16:23:24Z pagameba $
/**
* Class: Jx.Button.Combo
*
@@ -21456,7 +21456,7 @@
this.add(this.options.items);
}
var button = this;
- this.addEvent('click', (function(e) {
+ this.addEvent('click', function(e) {
if (this.list.count() === 0) {
return;
}
@@ -21482,11 +21482,11 @@
this.contentContainer.setStyle('visibility','');
- document.addEvent('mousedown', this.hideWatcher);
- document.addEvent('keyup', this.keypressWatcher);
+ document.addEvent('mousedown', this.bound.mousedown);
+ document.addEvent('keyup', this.bound.keypress);
this.fireEvent('show', this);
- }).bindWithEvent(this.menu));
+ }.bindWithEvent(this.menu));
this.menu.addEvents({
'show': (function() {
@@ -25056,8 +25056,15 @@
* Option: disabled
* {True|False} defaults to false. Whether this field is disabled.
*/
- disabled : false
-
+ disabled : false,
+ /**
+ * Option: defaultAction
+ * {Boolean} defaults to false, if true and this field is a button
+ * of some kind (Jx.Button, a button or an input of type submit) then
+ * if the user hits the enter key on any field in the form except a
+ * textarea, this field will be activated as if clicked
+ */
+ defaultAction: false
},
/**
@@ -25251,6 +25258,19 @@
enable : function () {
this.field.erase("disabled");
this.field.removeClass('jxFieldDisabled');
+ },
+
+ /**
+ * APIMethod: addTo
+ *
+ */
+ addTo: function(what) {
+ if (what instanceof Jx.Fieldset || what instanceof Jx.Form) {
+ what.add(this);
+ } else {
+ this.parent(what);
+ }
+ return this;
}
});
@@ -25404,6 +25424,15 @@
*/
name: ''
},
+
+ /**
+ * Property: defaultAction
+ * the default field to activate if the user hits the enter key in this
+ * form. Set by specifying default: true as an option to a field. Will
+ * only work if the default is a Jx button field or an input of a type
+ * that is a button
+ */
+ defaultAction: null,
/**
* Property: fields
@@ -25427,7 +25456,18 @@
'method' : this.options.method,
'action' : this.options.action,
'class' : 'jxForm',
- 'name' : this.options.name
+ 'name' : this.options.name,
+ events: {
+ keypress: function(e) {
+ if (e.key == 'enter' &&
+ e.target.tagName != "TEXTAREA" &&
+ this.defaultAction &&
+ this.defaultAction.click) {
+ document.id(this.defaultAction).focus();
+ this.defaultAction.click();
+ }
+ }.bind(this)
+ }
});
if (this.options.fileUpload) {
@@ -25450,9 +25490,11 @@
*/
addField : function (field) {
this.fields.set(field.id, field);
+ if (field.options.defaultAction) {
+ this.defaultAction = field;
+ }
},
-
/**
* Method: isValid
* Determines if the form passes validation
@@ -31689,7 +31731,21 @@
this.domObj.grab(field);
}
return this;
+ },
+
+ /**
+ * APIMethod: addTo
+ *
+ */
+ addTo: function(what) {
+ if (what instanceof Jx.Form) {
+ this.form = what;
+ } else if (what instanceof Jx.Fieldset) {
+ this.form = what.form;
+ }
+ return this.parent(what);
}
+
});
// $Id: $
/**
@@ -32199,6 +32255,9 @@
*/
template: '<span class="jxInputContainer"><label class="jxInputLabel"></label><div class="jxInputButton"></div><span class="jxInputTag"></span></span>'
},
+
+ button: null,
+
/**
* Property: type
* The type of this field
@@ -32207,14 +32266,17 @@
processTemplate: function(template, classes, container) {
var h = this.parent(template, classes, container);
- var b = new Jx.Button(this.options.buttonOptions);
+ this.button = new Jx.Button(this.options.buttonOptions);
var c = h.get('jxInputButton');
if (c) {
- b.domObj.replaces(c);
+ this.button.domObj.replaces(c);
}
return h;
+ },
+
+ click: function() {
+ this.button.clicked();
}
-
});// $Id: $
/**
* Class: Jx.Field.Password
More information about the fusion-commits
mailing list