toolbarItem reimplemented

This commit is contained in:
Ezequiel Bergamaschi 2014-04-27 23:59:35 -03:00
parent 107a59132a
commit 715d3d49b6

View File

@ -42,36 +42,24 @@ mindplot.widget.ToolbarPaneItem = new Class({
panelElem.css('cursor', 'default'); panelElem.css('cursor', 'default');
var buttonElem = this.getButtonElem(); var buttonElem = this.getButtonElem();
var item = this; var me = this;
this._tip = new mindplot.widget.FloatingTip(buttonElem, { this._tip = new mindplot.widget.FloatingTip(buttonElem, {
html: true, html: true,
position: 'bottom', placement: 'bottom',
arrowOffset : 5,
center: true,
arrowSize: 7,
showDelay: 0,
hideDelay: 0,
content: function() { content: function() {
return item._updateSelectedItem(); return me._updateSelectedItem();
}.bind(this), },
className: 'toolbarPaneTip', className: 'toolbarPaneTip',
motionOnShow:false, trigger: 'manual'
motionOnHide:false,
motion: 0,
distance: 0,
showOn: 'xxxx',
hideOn: 'xxxx',
preventHideOnOver:true,
offset: {x:-4,y:0}
}); });
this._tip.addEvent('hide', function() { this._tip.addEvent('hide', function() {
this._visible = false me._visible = false
}.bind(this)); });
this._tip.addEvent('show', function() { this._tip.addEvent('show', function() {
this._visible = true me._visible = true
}.bind(this)); });
return panelElem; return panelElem;
}, },
@ -87,7 +75,7 @@ mindplot.widget.ToolbarPaneItem = new Class({
show : function() { show : function() {
if (!this.isVisible()) { if (!this.isVisible()) {
this.parent(); this.parent();
this._tip.show(this.getButtonElem()); this._tip.show();
this.getButtonElem().className = 'buttonExtActive'; this.getButtonElem().className = 'buttonExtActive';
} }
}, },
@ -95,7 +83,7 @@ mindplot.widget.ToolbarPaneItem = new Class({
hide : function() { hide : function() {
if (this.isVisible()) { if (this.isVisible()) {
this.parent(); this.parent();
this._tip.hide(this.getButtonElem()); this._tip.hide();
this.getButtonElem().className = 'buttonExtOn'; this.getButtonElem().className = 'buttonExtOn';
} }
}, },