Fix some more attribute issues, silenceing some attribute warnings

This commit is contained in:
Nathan Gray 2012-07-25 22:37:56 +00:00
parent 346bfe1dcf
commit d65066341b
4 changed files with 27 additions and 1 deletions

View File

@ -124,6 +124,14 @@ function et2_checkType(_val, _type, _attr, _cname)
{
return _val === "true";
}
if(lcv === "0" || lcv === "1")
{
return _val === "1";
}
}
else if (typeof _val == "number")
{
return _val != 0;
}
return _err();

View File

@ -22,6 +22,12 @@
*/
var et2_box = et2_baseWidget.extend([et2_IDetachedDOM], {
attributes: {
// Not needed
"rows": {"ignore": true},
"cols": {"ignore": true}
},
createNamespace: true,
init: function() {

View File

@ -83,3 +83,15 @@ var et2_number = et2_textbox.extend({
et2_register_widget(et2_number, ["int", "integer", "float"]);
/**
* Extend read-only to tell it to ignore special attributes, which
* would cause warnings otherwise
*/
var et2_number_ro = et2_textbox_ro.extend({
attributes: {
"min": {"ignore": true},
"max": {"ignore": true},
"precision": {"ignore": true}
}
});
et2_register_widget(et2_number_ro, ["int_ro", "integer_ro", "float_ro"]);

View File

@ -229,5 +229,5 @@ var et2_textbox_ro = et2_valueWidget.extend([et2_IDetachedDOM], {
}
});
et2_register_widget(et2_textbox_ro, ["textbox_ro", "int_ro", "integer_ro", "float_ro"]);
et2_register_widget(et2_textbox_ro, ["textbox_ro"]);