Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

HTML checkbox widget #285

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

olaf-k commented Dec 14, 2012

This adds a very simple checkbox widget to the HTML library. Its only ability is a double-binding on its "checked" property.

@piuccio piuccio commented on an outdated diff Dec 18, 2012

src/aria/html/CheckBox.js
+ INVALID_USAGE : "Widget %1 can only be used as a %2."
+ },
+ $constructor : function(cfg, context, line) {
+ this.$cfgBean = "aria.html.beans.CheckBoxCfg.Properties";
+
+ cfg.tagName = "input";
+ cfg.attributes = cfg.attributes || {};
+ cfg.attributes.type = "checkbox";
+ cfg.on = cfg.on || {};
+
+ this._registerChange(cfg.on, context);
+
+ this.$Element.constructor.call(this, cfg, context, line);
+ },
+ $destructor : function() {
+ this.$Element.$destructor.call(this);
@piuccio

piuccio Dec 18, 2012

Contributor

It's useless to define a $destructor if then you simply call the parent

@piuccio piuccio and 1 other commented on an outdated diff Dec 18, 2012

src/aria/html/CheckBox.js
+ *
+ * @param {String}
+ * name Name of the property
+ * @param {Object}
+ * value Value of the changed property
+ * @param {Object}
+ * oldValue Value of the property before the change happened
+ */
+ onbind : function(name, value, oldValue) {
+ if (name === "checked") {
+ this._domElt.checked = value;
+ }
+ },
+
+ /**
+ * OK, listen, I honestly have no idea what this does since I copied/pasted it from TextInput.js, but it's
@piuccio

piuccio Dec 18, 2012

Contributor

RLY??

@olaf-k

olaf-k Dec 18, 2012

not my fault
that's Honest Driven Development

@olaf-k olaf-k pushed a commit that referenced this pull request Jan 8, 2013

@olaf-k-1a olaf-k-1a + Fabio Crisci feat #285 Created a simple HTML checkbox widget 0476a8c
Contributor

piuccio commented Jan 8, 2013

Integrated in 0476a8c

@piuccio piuccio closed this Jan 8, 2013

@olaf-k olaf-k deleted the unknown repository branch Jan 8, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment