wxxsd/wxxsd123/UEditor/_src/ui/splitbutton.js
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
///import core
///import uicore
///import ui/stateful.js
(function (){
var utils = baidu.editor.utils,
uiUtils = baidu.editor.ui.uiUtils,
domUtils = baidu.editor.dom.domUtils,
UIBase = baidu.editor.ui.UIBase,
Stateful = baidu.editor.ui.Stateful,
SplitButton = baidu.editor.ui.SplitButton = function (options){
this.initOptions(options);
this.initSplitButton();
};
SplitButton.prototype = {
popup: null,
uiName: 'splitbutton',
title: '',
initSplitButton: function (){
this.initUIBase();
this.Stateful_init();
var me = this;
if (this.popup != null) {
var popup = this.popup;
this.popup = null;
this.setPopup(popup);
}
},
_UIBase_postRender: UIBase.prototype.postRender,
postRender: function (){
this.Stateful_postRender();
this._UIBase_postRender();
},
setPopup: function (popup){
if (this.popup === popup) return;
if (this.popup != null) {
this.popup.dispose();
}
popup.addListener('show', utils.bind(this._onPopupShow, this));
popup.addListener('hide', utils.bind(this._onPopupHide, this));
popup.addListener('postrender', utils.bind(function (){
popup.getDom('body').appendChild(
uiUtils.createElementByHtml('<div id="' +
this.popup.id + '_bordereraser" class="edui-bordereraser edui-background" style="width:' +
(uiUtils.getClientRect(this.getDom()).width - 2) + 'px"></div>')
);
popup.getDom().className += ' ' + this.className;
}, this));
this.popup = popup;
},
_onPopupShow: function (){
this.addState('opened');
},
_onPopupHide: function (){
this.removeState('opened');
},
getHtmlTpl: function (){
return '<div id="##" class="edui-box %%">' +
'<div '+ (this.title ? 'title="' + this.title + '"' : '') +' id="##_state" stateful><div class="%%-body">' +
'<div id="##_button_body" class="edui-box edui-button-body" onclick="$$._onButtonClick(event, this);">' +
'<div class="edui-box edui-icon"></div>' +
后面还有 27 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
