|
|
|
@ -308,163 +308,163 @@ BI.Pane = BI.inherit(BI.Widget, {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
BI.Pane.EVENT_LOADED = "EVENT_LOADED";/** |
|
|
|
|
* guy |
|
|
|
|
* 这仅仅只是一个超类, 所有简单控件的基类 |
|
|
|
|
* 1、类的控制, |
|
|
|
|
* 2、title的控制 |
|
|
|
|
* 3、文字超过边界显示3个点 |
|
|
|
|
* 4、cursor默认pointor |
|
|
|
|
* @class BI.Single |
|
|
|
|
* @extends BI.Widget |
|
|
|
|
* @abstract |
|
|
|
|
*/ |
|
|
|
|
BI.Single = BI.inherit(BI.Widget, { |
|
|
|
|
_defaultConfig: function () { |
|
|
|
|
var conf = BI.Single.superclass._defaultConfig.apply(this, arguments); |
|
|
|
|
return BI.extend(conf, { |
|
|
|
|
baseCls: (conf.baseCls || "") + " bi-single", |
|
|
|
|
readonly: false, |
|
|
|
|
title: null, |
|
|
|
|
warningTitle: null, |
|
|
|
|
tipType: null, // success或warning
|
|
|
|
|
value: null |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_showToolTip: function (e, opt) { |
|
|
|
|
opt || (opt = {}); |
|
|
|
|
var self = this; |
|
|
|
|
var type = this.getTipType() || (this.isEnabled() ? "success" : "warning"); |
|
|
|
|
var title = type === "success" ? this.getTitle() : (this.getWarningTitle() || this.getTitle()); |
|
|
|
|
if (BI.isKey(title)) { |
|
|
|
|
BI.Tooltips.show(e, this.getName(), title, type, this, opt); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_hideTooltip: function () { |
|
|
|
|
var self = this; |
|
|
|
|
var tooltip = BI.Tooltips.get(this.getName()); |
|
|
|
|
if (BI.isNotNull(tooltip)) { |
|
|
|
|
tooltip.element.fadeOut(200, function () { |
|
|
|
|
BI.Tooltips.remove(self.getName()); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_init: function () { |
|
|
|
|
BI.Single.superclass._init.apply(this, arguments); |
|
|
|
|
var self = this, o = this.options; |
|
|
|
|
if (BI.isKey(o.title) || BI.isKey(o.warningTitle) |
|
|
|
|
|| BI.isFunction(o.title) || BI.isFunction(o.warningTitle)) { |
|
|
|
|
this.enableHover(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
enableHover: function (opt) { |
|
|
|
|
opt || (opt = {}); |
|
|
|
|
var self = this; |
|
|
|
|
if (!this._hoverBinded) { |
|
|
|
|
this.element.on("mouseenter.title" + this.getName(), function (e) { |
|
|
|
|
self._e = e; |
|
|
|
|
if (self.getTipType() === "warning" || (BI.isKey(self.getWarningTitle()) && !self.isEnabled())) { |
|
|
|
|
self.timeout = BI.delay(function () { |
|
|
|
|
self._showToolTip(self._e || e, opt); |
|
|
|
|
}, 200); |
|
|
|
|
} else if (self.getTipType() === "success" || self.isEnabled()) { |
|
|
|
|
self.timeout = BI.delay(function () { |
|
|
|
|
self._showToolTip(self._e || e, opt); |
|
|
|
|
}, 500); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
this.element.on("mousemove.title" + this.getName(), function (e) { |
|
|
|
|
self._e = e; |
|
|
|
|
if (!self.element.__isMouseInBounds__(e)) { |
|
|
|
|
if (BI.isNotNull(self.timeout)) { |
|
|
|
|
clearTimeout(self.timeout); |
|
|
|
|
} |
|
|
|
|
self._hideTooltip(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
this.element.on("mouseleave.title" + this.getName(), function () { |
|
|
|
|
self._e = null; |
|
|
|
|
if (BI.isNotNull(self.timeout)) { |
|
|
|
|
clearTimeout(self.timeout); |
|
|
|
|
} |
|
|
|
|
self._hideTooltip(); |
|
|
|
|
}); |
|
|
|
|
this._hoverBinded = true; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
disabledHover: function () { |
|
|
|
|
//取消hover事件
|
|
|
|
|
if (BI.isNotNull(this.timeout)) { |
|
|
|
|
clearTimeout(this.timeout); |
|
|
|
|
} |
|
|
|
|
this._hideTooltip(); |
|
|
|
|
$(this.element).unbind("mouseenter.title" + this.getName()) |
|
|
|
|
.unbind("mousemove.title" + this.getName()) |
|
|
|
|
.unbind("mouseleave.title" + this.getName()); |
|
|
|
|
this._hoverBinded = false; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
populate: function (items) { |
|
|
|
|
this.items = items || []; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
//opt: {container: '', belowMouse: false}
|
|
|
|
|
setTitle: function (title, opt) { |
|
|
|
|
this.options.title = title; |
|
|
|
|
if (BI.isKey(title)) { |
|
|
|
|
this.enableHover(opt); |
|
|
|
|
} else { |
|
|
|
|
this.disabledHover(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setWarningTitle: function (title, opt) { |
|
|
|
|
this.options.warningTitle = title; |
|
|
|
|
if (BI.isKey(title)) { |
|
|
|
|
this.enableHover(opt); |
|
|
|
|
} else { |
|
|
|
|
this.disabledHover(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
getTipType: function () { |
|
|
|
|
return this.options.tipType; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
isReadOnly: function () { |
|
|
|
|
return !!this.options.readonly; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
getTitle: function () { |
|
|
|
|
var title = this.options.title; |
|
|
|
|
if(BI.isFunction(title)) { |
|
|
|
|
return title(); |
|
|
|
|
} |
|
|
|
|
return title; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
getWarningTitle: function () { |
|
|
|
|
var title = this.options.warningTitle; |
|
|
|
|
if(BI.isFunction(title)) { |
|
|
|
|
return title(); |
|
|
|
|
} |
|
|
|
|
return title; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setValue: function (val) { |
|
|
|
|
if (!this.options.readonly) { |
|
|
|
|
this.options.value = val; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
getValue: function () { |
|
|
|
|
return this.options.value; |
|
|
|
|
} |
|
|
|
|
BI.Pane.EVENT_LOADED = "EVENT_LOADED";/** |
|
|
|
|
* guy |
|
|
|
|
* 这仅仅只是一个超类, 所有简单控件的基类 |
|
|
|
|
* 1、类的控制, |
|
|
|
|
* 2、title的控制 |
|
|
|
|
* 3、文字超过边界显示3个点 |
|
|
|
|
* 4、cursor默认pointor |
|
|
|
|
* @class BI.Single |
|
|
|
|
* @extends BI.Widget |
|
|
|
|
* @abstract |
|
|
|
|
*/ |
|
|
|
|
BI.Single = BI.inherit(BI.Widget, { |
|
|
|
|
_defaultConfig: function () { |
|
|
|
|
var conf = BI.Single.superclass._defaultConfig.apply(this, arguments); |
|
|
|
|
return BI.extend(conf, { |
|
|
|
|
baseCls: (conf.baseCls || "") + " bi-single", |
|
|
|
|
readonly: false, |
|
|
|
|
title: null, |
|
|
|
|
warningTitle: null, |
|
|
|
|
tipType: null, // success或warning
|
|
|
|
|
value: null |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_showToolTip: function (e, opt) { |
|
|
|
|
opt || (opt = {}); |
|
|
|
|
var self = this; |
|
|
|
|
var type = this.getTipType() || (this.isEnabled() ? "success" : "warning"); |
|
|
|
|
var title = type === "success" ? this.getTitle() : (this.getWarningTitle() || this.getTitle()); |
|
|
|
|
if (BI.isKey(title)) { |
|
|
|
|
BI.Tooltips.show(e, this.getName(), title, type, this, opt); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_hideTooltip: function () { |
|
|
|
|
var self = this; |
|
|
|
|
var tooltip = BI.Tooltips.get(this.getName()); |
|
|
|
|
if (BI.isNotNull(tooltip)) { |
|
|
|
|
tooltip.element.fadeOut(200, function () { |
|
|
|
|
BI.Tooltips.remove(self.getName()); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_init: function () { |
|
|
|
|
BI.Single.superclass._init.apply(this, arguments); |
|
|
|
|
var self = this, o = this.options; |
|
|
|
|
if (BI.isKey(o.title) || BI.isKey(o.warningTitle) |
|
|
|
|
|| BI.isFunction(o.title) || BI.isFunction(o.warningTitle)) { |
|
|
|
|
this.enableHover(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
enableHover: function (opt) { |
|
|
|
|
opt || (opt = {}); |
|
|
|
|
var self = this; |
|
|
|
|
if (!this._hoverBinded) { |
|
|
|
|
this.element.on("mouseenter.title" + this.getName(), function (e) { |
|
|
|
|
self._e = e; |
|
|
|
|
if (self.getTipType() === "warning" || (BI.isKey(self.getWarningTitle()) && !self.isEnabled())) { |
|
|
|
|
self.timeout = BI.delay(function () { |
|
|
|
|
self._showToolTip(self._e || e, opt); |
|
|
|
|
}, 200); |
|
|
|
|
} else if (self.getTipType() === "success" || self.isEnabled()) { |
|
|
|
|
self.timeout = BI.delay(function () { |
|
|
|
|
self._showToolTip(self._e || e, opt); |
|
|
|
|
}, 500); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
this.element.on("mousemove.title" + this.getName(), function (e) { |
|
|
|
|
self._e = e; |
|
|
|
|
if (!self.element.__isMouseInBounds__(e)) { |
|
|
|
|
if (BI.isNotNull(self.timeout)) { |
|
|
|
|
clearTimeout(self.timeout); |
|
|
|
|
} |
|
|
|
|
self._hideTooltip(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
this.element.on("mouseleave.title" + this.getName(), function () { |
|
|
|
|
self._e = null; |
|
|
|
|
if (BI.isNotNull(self.timeout)) { |
|
|
|
|
clearTimeout(self.timeout); |
|
|
|
|
} |
|
|
|
|
self._hideTooltip(); |
|
|
|
|
}); |
|
|
|
|
this._hoverBinded = true; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
disabledHover: function () { |
|
|
|
|
//取消hover事件
|
|
|
|
|
if (BI.isNotNull(this.timeout)) { |
|
|
|
|
clearTimeout(this.timeout); |
|
|
|
|
} |
|
|
|
|
this._hideTooltip(); |
|
|
|
|
$(this.element).unbind("mouseenter.title" + this.getName()) |
|
|
|
|
.unbind("mousemove.title" + this.getName()) |
|
|
|
|
.unbind("mouseleave.title" + this.getName()); |
|
|
|
|
this._hoverBinded = false; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
populate: function (items) { |
|
|
|
|
this.items = items || []; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
//opt: {container: '', belowMouse: false}
|
|
|
|
|
setTitle: function (title, opt) { |
|
|
|
|
this.options.title = title; |
|
|
|
|
if (BI.isKey(title)) { |
|
|
|
|
this.enableHover(opt); |
|
|
|
|
} else { |
|
|
|
|
this.disabledHover(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setWarningTitle: function (title, opt) { |
|
|
|
|
this.options.warningTitle = title; |
|
|
|
|
if (BI.isKey(title)) { |
|
|
|
|
this.enableHover(opt); |
|
|
|
|
} else { |
|
|
|
|
this.disabledHover(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
getTipType: function () { |
|
|
|
|
return this.options.tipType; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
isReadOnly: function () { |
|
|
|
|
return !!this.options.readonly; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
getTitle: function () { |
|
|
|
|
var title = this.options.title; |
|
|
|
|
if(BI.isFunction(title)) { |
|
|
|
|
return title(); |
|
|
|
|
} |
|
|
|
|
return title; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
getWarningTitle: function () { |
|
|
|
|
var title = this.options.warningTitle; |
|
|
|
|
if(BI.isFunction(title)) { |
|
|
|
|
return title(); |
|
|
|
|
} |
|
|
|
|
return title; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setValue: function (val) { |
|
|
|
|
if (!this.options.readonly) { |
|
|
|
|
this.options.value = val; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
getValue: function () { |
|
|
|
|
return this.options.value; |
|
|
|
|
} |
|
|
|
|
});/** |
|
|
|
|
* guy 表示一行数据,通过position来定位位置的数据 |
|
|
|
|
* @class BI.Text |
|
|
|
@ -918,82 +918,82 @@ BI.BasicButton = BI.inherit(BI.Single, {
|
|
|
|
|
BI.BasicButton.superclass.destroy.apply(this, arguments); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE";/** |
|
|
|
|
* 表示一个可以展开的节点, 不仅有选中状态而且有展开状态 |
|
|
|
|
* |
|
|
|
|
* Created by GUY on 2015/9/9. |
|
|
|
|
* @class BI.NodeButton |
|
|
|
|
* @extends BI.BasicButton |
|
|
|
|
* @abstract |
|
|
|
|
*/ |
|
|
|
|
BI.NodeButton = BI.inherit(BI.BasicButton, { |
|
|
|
|
_defaultConfig: function() { |
|
|
|
|
var conf = BI.NodeButton.superclass._defaultConfig.apply(this, arguments); |
|
|
|
|
return BI.extend( conf, { |
|
|
|
|
baseCls: (conf.baseCls || "") + " bi-node", |
|
|
|
|
open: false |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_init:function() { |
|
|
|
|
BI.NodeButton.superclass._init.apply(this, arguments); |
|
|
|
|
var self = this; |
|
|
|
|
BI.nextTick(function(){ |
|
|
|
|
self.setOpened(self.isOpened()); |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
doClick: function(){ |
|
|
|
|
BI.NodeButton.superclass.doClick.apply(this, arguments); |
|
|
|
|
this.setOpened(!this.isOpened()); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
isOnce: function(){ |
|
|
|
|
return false; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
isOpened: function(){ |
|
|
|
|
return !!this.options.open; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setOpened: function(b){ |
|
|
|
|
this.options.open = !!b; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
triggerCollapse: function(){ |
|
|
|
|
if(this.isOpened()) { |
|
|
|
|
this.setOpened(false); |
|
|
|
|
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, this.getValue(), this); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
triggerExpand: function(){ |
|
|
|
|
if(!this.isOpened()) { |
|
|
|
|
this.setOpened(true); |
|
|
|
|
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, this.getValue(), this); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
});/** |
|
|
|
|
* guy |
|
|
|
|
* tip提示 |
|
|
|
|
* zIndex在10亿级别 |
|
|
|
|
* @class BI.Tip |
|
|
|
|
* @extends BI.Single |
|
|
|
|
* @abstract |
|
|
|
|
*/ |
|
|
|
|
BI.Tip = BI.inherit(BI.Single, { |
|
|
|
|
_defaultConfig: function() { |
|
|
|
|
var conf = BI.Link.superclass._defaultConfig.apply(this, arguments); |
|
|
|
|
return BI.extend(conf, { |
|
|
|
|
baseCls: (conf.baseCls || "") + " bi-tip", |
|
|
|
|
zIndex: BI.zIndex_tip |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_init : function() { |
|
|
|
|
BI.Tip.superclass._init.apply(this, arguments); |
|
|
|
|
this.element.css({"zIndex": this.options.zIndex}); |
|
|
|
|
} |
|
|
|
|
BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE";/** |
|
|
|
|
* 表示一个可以展开的节点, 不仅有选中状态而且有展开状态 |
|
|
|
|
* |
|
|
|
|
* Created by GUY on 2015/9/9. |
|
|
|
|
* @class BI.NodeButton |
|
|
|
|
* @extends BI.BasicButton |
|
|
|
|
* @abstract |
|
|
|
|
*/ |
|
|
|
|
BI.NodeButton = BI.inherit(BI.BasicButton, { |
|
|
|
|
_defaultConfig: function() { |
|
|
|
|
var conf = BI.NodeButton.superclass._defaultConfig.apply(this, arguments); |
|
|
|
|
return BI.extend( conf, { |
|
|
|
|
baseCls: (conf.baseCls || "") + " bi-node", |
|
|
|
|
open: false |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_init:function() { |
|
|
|
|
BI.NodeButton.superclass._init.apply(this, arguments); |
|
|
|
|
var self = this; |
|
|
|
|
BI.nextTick(function(){ |
|
|
|
|
self.setOpened(self.isOpened()); |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
doClick: function(){ |
|
|
|
|
BI.NodeButton.superclass.doClick.apply(this, arguments); |
|
|
|
|
this.setOpened(!this.isOpened()); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
isOnce: function(){ |
|
|
|
|
return false; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
isOpened: function(){ |
|
|
|
|
return !!this.options.open; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setOpened: function(b){ |
|
|
|
|
this.options.open = !!b; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
triggerCollapse: function(){ |
|
|
|
|
if(this.isOpened()) { |
|
|
|
|
this.setOpened(false); |
|
|
|
|
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, this.getValue(), this); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
triggerExpand: function(){ |
|
|
|
|
if(!this.isOpened()) { |
|
|
|
|
this.setOpened(true); |
|
|
|
|
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, this.getValue(), this); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
});/** |
|
|
|
|
* guy |
|
|
|
|
* tip提示 |
|
|
|
|
* zIndex在10亿级别 |
|
|
|
|
* @class BI.Tip |
|
|
|
|
* @extends BI.Single |
|
|
|
|
* @abstract |
|
|
|
|
*/ |
|
|
|
|
BI.Tip = BI.inherit(BI.Single, { |
|
|
|
|
_defaultConfig: function() { |
|
|
|
|
var conf = BI.Link.superclass._defaultConfig.apply(this, arguments); |
|
|
|
|
return BI.extend(conf, { |
|
|
|
|
baseCls: (conf.baseCls || "") + " bi-tip", |
|
|
|
|
zIndex: BI.zIndex_tip |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_init : function() { |
|
|
|
|
BI.Tip.superclass._init.apply(this, arguments); |
|
|
|
|
this.element.css({"zIndex": this.options.zIndex}); |
|
|
|
|
} |
|
|
|
|
});/** |
|
|
|
|
* Created by GUY on 2015/6/26. |
|
|
|
|
* @class BI.ButtonGroup |
|
|
|
@ -17747,12 +17747,12 @@ BI.CodeEditor = BI.inherit(BI.Single, {
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.editor.on("focus", function () { |
|
|
|
|
watermark.setVisible(false); |
|
|
|
|
self.watermark.setVisible(false); |
|
|
|
|
self.fireEvent(BI.CodeEditor.EVENT_FOCUS); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.editor.on("blur", function () { |
|
|
|
|
watermark.setVisible(BI.isEmptyString(self.getValue())); |
|
|
|
|
self.watermark.setVisible(BI.isEmptyString(self.getValue())); |
|
|
|
|
self.fireEvent(BI.CodeEditor.EVENT_BLUR); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
@ -17761,21 +17761,21 @@ BI.CodeEditor = BI.inherit(BI.Single, {
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
//水印
|
|
|
|
|
var watermark = BI.createWidget({ |
|
|
|
|
this.watermark = BI.createWidget({ |
|
|
|
|
type: "bi.label", |
|
|
|
|
text: o.watermark, |
|
|
|
|
cls: "bi-water-mark", |
|
|
|
|
whiteSpace: "nowrap", |
|
|
|
|
textAlign: "left" |
|
|
|
|
}); |
|
|
|
|
watermark.element.bind( |
|
|
|
|
this.watermark.element.bind( |
|
|
|
|
"mousedown", function (e) { |
|
|
|
|
self.insertString(""); |
|
|
|
|
self.editor.focus(); |
|
|
|
|
e.stopEvent(); |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
watermark.element.bind("click", function (e) { |
|
|
|
|
this.watermark.element.bind("click", function (e) { |
|
|
|
|
self.editor.focus(); |
|
|
|
|
e.stopEvent(); |
|
|
|
|
}); |
|
|
|
@ -17783,7 +17783,7 @@ BI.CodeEditor = BI.inherit(BI.Single, {
|
|
|
|
|
type: "bi.absolute", |
|
|
|
|
element: this, |
|
|
|
|
items: [{ |
|
|
|
|
el: watermark, |
|
|
|
|
el: this.watermark, |
|
|
|
|
top: 0, |
|
|
|
|
left: 5 |
|
|
|
|
}] |
|
|
|
@ -17801,6 +17801,15 @@ BI.CodeEditor = BI.inherit(BI.Single, {
|
|
|
|
|
this.editor.setOption("readOnly", b === true ? false : "nocursor") |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_checkWaterMark: function () { |
|
|
|
|
var o = this.options; |
|
|
|
|
if (BI.isEmptyString(this.editor.getValue()) && BI.isKey(o.watermark)) { |
|
|
|
|
this.watermark && this.watermark.visible(); |
|
|
|
|
} else { |
|
|
|
|
this.watermark && this.watermark.invisible(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
insertParam: function (param) { |
|
|
|
|
var from = this.editor.getCursor(); |
|
|
|
|
this.editor.replaceSelection(param); |
|
|
|
@ -17855,7 +17864,8 @@ BI.CodeEditor = BI.inherit(BI.Single, {
|
|
|
|
|
} else { |
|
|
|
|
self.insertString(item); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
this._checkWaterMark(); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
focus: function () { |
|
|
|
@ -20261,32 +20271,32 @@ BI.Tooltip = BI.inherit(BI.Tip, {
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
BI.shortcut("bi.tooltip", BI.Tooltip);/** |
|
|
|
|
* 下拉 |
|
|
|
|
* @class BI.Trigger |
|
|
|
|
* @extends BI.Single |
|
|
|
|
* @abstract |
|
|
|
|
*/ |
|
|
|
|
BI.Trigger = BI.inherit(BI.Single, { |
|
|
|
|
_defaultConfig: function() { |
|
|
|
|
var conf = BI.Trigger.superclass._defaultConfig.apply(this, arguments); |
|
|
|
|
return BI.extend(conf, { |
|
|
|
|
baseCls: (conf.baseCls || "") + " bi-trigger cursor-pointer", |
|
|
|
|
height: 30 |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_init : function() { |
|
|
|
|
BI.Trigger.superclass._init.apply(this, arguments); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setKey: function(){ |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
getKey: function(){ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
BI.shortcut("bi.tooltip", BI.Tooltip);/** |
|
|
|
|
* 下拉 |
|
|
|
|
* @class BI.Trigger |
|
|
|
|
* @extends BI.Single |
|
|
|
|
* @abstract |
|
|
|
|
*/ |
|
|
|
|
BI.Trigger = BI.inherit(BI.Single, { |
|
|
|
|
_defaultConfig: function() { |
|
|
|
|
var conf = BI.Trigger.superclass._defaultConfig.apply(this, arguments); |
|
|
|
|
return BI.extend(conf, { |
|
|
|
|
baseCls: (conf.baseCls || "") + " bi-trigger cursor-pointer", |
|
|
|
|
height: 30 |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_init : function() { |
|
|
|
|
BI.Trigger.superclass._init.apply(this, arguments); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setKey: function(){ |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
getKey: function(){ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
});// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|