Wrapper for native browser controls
LSD.Widget autoloads all of the modules that are defined in Old.Module namespace unless LSD.modules array is provided.
So if a new module needs to be included into the base class, then it only needs to be required.
LSD.Native = new Class({
Includes: [
LSD.Node,
LSD.Module.Attributes,
LSD.Module.Events,
LSD.Module.Expectations,
LSD.Module.Layout,
LSD.Module.DOM,
LSD.Module.Actions,
LSD.Module.Command,
LSD.Module.Target
],
options: {
writable: false,
events: {
_native: {
enable: function() {
this.element.erase('disabled');
},
disable: function() {
this.element.setProperty('disabled', true);
}
}
}
},
initialize: function() {
this.parent.apply(this, arguments);
if (this.options.writable && !this.attributes.tabindex && (this.options.focusable !== false)) this.setAttribute('tabindex', 0)
this.addPseudo(this.options.writable ? 'read-write' : 'read-only');
if (this.element) this.build()
},
setContent: function(content) {
this.toElement().innerHTML = content;
}
});
LSD.Native.prototype.addStates('built', 'attached');
new LSD.Type('Native');
Inject native widgets into default widget pool as a fallback
LSD.Element.pool[LSD.useNative ? 'unshift' : 'push'](LSD.Native);