📄 editableitem.js
字号:
/*
* Ext JS Library 2.2
* Copyright(c) 2006-2008, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/
Ext.menu.EditableItem = Ext.extend(Ext.menu.BaseItem, {
itemCls : "x-menu-item",
hideOnClick: false,
initComponent: function(){
Ext.menu.EditableItem.superclass.initComponent.call(this);
this.addEvents('keyup');
this.editor = this.editor || new Ext.form.TextField();
if(this.text) {
this.editor.setValue(this.text);
}
},
onRender: function(container){
var s = container.createChild({
cls: this.itemCls,
html: '<img src="' + this.icon + '" class="x-menu-item-icon" style="margin: 3px 3px 2px 2px;" />'
});
Ext.apply(this.config, {width: 125});
this.editor.render(s);
this.el = s;
this.relayEvents(this.editor.el, ["keyup"]);
if(Ext.isGecko) {
s.setStyle('overflow', 'auto');
}
Ext.menu.EditableItem.superclass.onRender.call(this, container);
},
getValue: function(){
return this.editor.getValue();
},
setValue: function(value){
this.editor.setValue(value);
},
isValid: function(preventMark){
return this.editor.isValid(preventMark);
}
});
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -