mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 11:41:20 +08:00
Checkbox
This commit is contained in:
@ -46,7 +46,7 @@ export class Checkbox {
|
|||||||
let setAriaInvalid = (v) => this.domElement.setAttribute('aria-invalid', v)
|
let setAriaInvalid = (v) => this.domElement.setAttribute('aria-invalid', v)
|
||||||
let setAriaDisabled = (v) => this.domElement.setAttribute('aria-disabled', v)
|
let setAriaDisabled = (v) => this.domElement.setAttribute('aria-disabled', v)
|
||||||
|
|
||||||
Checkbox.config.invoke(this);
|
this.config = Checkbox.config.invoke(this);
|
||||||
|
|
||||||
setAriaRole('checkbox')
|
setAriaRole('checkbox')
|
||||||
setAriaInvalid('false')
|
setAriaInvalid('false')
|
||||||
@ -59,9 +59,9 @@ export class Checkbox {
|
|||||||
|
|
||||||
this.setCheckedProperty = setAriaChecked
|
this.setCheckedProperty = setAriaChecked
|
||||||
|
|
||||||
// TODO: FIXME!! MAKE MORE GOOD!!!!
|
// TODO: This is a hack and not a very good one at that
|
||||||
this.domElement.querySelector('.checkbox-off').classList.add(this.iconOff)
|
this.domElement.querySelector('.checkbox-off').classList.add(this.config.properties.iconOff.ios);
|
||||||
this.domElement.querySelector('.checkbox-on').classList.add(this.iconOn)
|
this.domElement.querySelector('.checkbox-on').classList.add(this.config.properties.iconOn.ios);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -10,6 +10,7 @@ let platformMode = Platform.getMode();
|
|||||||
|
|
||||||
export class IonicComponent {
|
export class IonicComponent {
|
||||||
constructor(ComponentClass, {
|
constructor(ComponentClass, {
|
||||||
|
properties,
|
||||||
bind,
|
bind,
|
||||||
enhanceRawElement,
|
enhanceRawElement,
|
||||||
delegates,
|
delegates,
|
||||||
@ -19,6 +20,8 @@ export class IonicComponent {
|
|||||||
ComponentClass.config = this
|
ComponentClass.config = this
|
||||||
this.componentCssName = util.pascalCaseToDashCase(ComponentClass.name)
|
this.componentCssName = util.pascalCaseToDashCase(ComponentClass.name)
|
||||||
|
|
||||||
|
this.properties = properties || (properties = {});
|
||||||
|
|
||||||
this.bind = bind || (bind = {})
|
this.bind = bind || (bind = {})
|
||||||
for (let attrName in bind) {
|
for (let attrName in bind) {
|
||||||
let binding = bind[attrName]
|
let binding = bind[attrName]
|
||||||
@ -86,6 +89,7 @@ export class IonicComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
properties: this.properties,
|
||||||
getDelegate(delegateName) {
|
getDelegate(delegateName) {
|
||||||
let cases = (config.delegates || {})[delegateName] || [];
|
let cases = (config.delegates || {})[delegateName] || [];
|
||||||
for (let i = 0; i < cases.length; i++) {
|
for (let i = 0; i < cases.length; i++) {
|
||||||
|
Reference in New Issue
Block a user