forked from fanruan/fineui
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.6 KiB
60 lines
1.6 KiB
/** |
|
* 文字trigger(右边小三角小一号的) == |
|
* |
|
* @class BI.SmallTextTrigger |
|
* @extends BI.Trigger |
|
*/ |
|
BI.SmallTextTrigger = BI.inherit(BI.Trigger, { |
|
_defaultConfig: function () { |
|
var conf = BI.SmallTextTrigger.superclass._defaultConfig.apply(this, arguments); |
|
return BI.extend(conf, { |
|
baseCls: (conf.baseCls || "") + " bi-text-trigger", |
|
height: 20, |
|
textHgap: 6, |
|
}); |
|
}, |
|
|
|
_init: function () { |
|
BI.SmallTextTrigger.superclass._init.apply(this, arguments); |
|
var self = this, o = this.options, c = this._const; |
|
this.text = BI.createWidget({ |
|
type: "bi.label", |
|
textAlign: "left", |
|
height: o.height, |
|
text: o.text, |
|
hgap: o.textHgap, |
|
vgap: o.textVgap, |
|
lgap: o.textLgap, |
|
rgap: o.textRgap, |
|
tgap: o.textTgap, |
|
bgap: o.textBgap, |
|
}); |
|
this.trigerButton = BI.createWidget({ |
|
type: "bi.trigger_icon_button", |
|
width: o.triggerWidth || o.height |
|
}); |
|
|
|
BI.createWidget({ |
|
element: this, |
|
type: "bi.horizontal_fill", |
|
items: [ |
|
{ |
|
el: this.text, |
|
width: "fill" |
|
}, { |
|
el: this.trigerButton, |
|
width: o.triggerWidth || o.height |
|
} |
|
] |
|
}); |
|
}, |
|
|
|
setValue: function (value) { |
|
this.text.setValue(value); |
|
}, |
|
|
|
setText: function (text) { |
|
this.text.setText(text); |
|
} |
|
}); |
|
BI.shortcut("bi.small_text_trigger", BI.SmallTextTrigger);
|
|
|