mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 06:07:57 +01:00
KeyboardShortcutTooltip reimplemented
This commit is contained in:
parent
a56850d214
commit
200d5c517a
@ -24,49 +24,49 @@ mindplot.widget.KeyboardShortcutTooltip = new Class({
|
||||
$assert(text, "text can not be null");
|
||||
this._text = text;
|
||||
|
||||
console.error("mindplot.widget.KeyboardShortcutTooltip must be implemented ...");
|
||||
// var children = buttonElem.children();
|
||||
// var tipElemId = buttonElem.id + "Tip";
|
||||
// var tipDiv = new Element('div', {id:tipElemId});
|
||||
// children[0].inject(tipDiv);
|
||||
// tipDiv.inject(buttonElem);
|
||||
//
|
||||
// this.parent(tipDiv, {
|
||||
// // Content can also be a function of the target element!
|
||||
// content: this._buildContent.pass(buttonElem, this),
|
||||
// html: true,
|
||||
// position: 'bottom',
|
||||
// arrowOffset : 10,
|
||||
// center: true,
|
||||
// arrowSize: 3,
|
||||
// offset : {x:0,y:-2},
|
||||
// className: 'keyboardShortcutTip',
|
||||
// preventHideOnOver : false,
|
||||
// motionOnShow:false,
|
||||
// motionOnHide:false,
|
||||
// fx: { 'duration': '100' }
|
||||
// });
|
||||
//
|
||||
// tipDiv.addEvent('click', function(e) {
|
||||
// tipDiv.fireEvent('mouseleave', e);
|
||||
// });
|
||||
var children = buttonElem.children().first();
|
||||
var tipElemId = buttonElem.id + "Tip";
|
||||
var tipDiv = $('<div></div>').attr('id', tipElemId);
|
||||
tipDiv.append(children);
|
||||
buttonElem.append(tipDiv);
|
||||
|
||||
this.parent(tipDiv, {
|
||||
//Content can also be a function of the target element!
|
||||
content: this._buildContent.pass(buttonElem, this),
|
||||
html: true,
|
||||
position: 'bottom',
|
||||
arrowOffset : 10,
|
||||
center: true,
|
||||
arrowSize: 3,
|
||||
offset : {x:0,y:-2},
|
||||
className: 'keyboardShortcutTip',
|
||||
preventHideOnOver : false,
|
||||
//FIXME: this options are not useful anymore
|
||||
motionOnShow:false,
|
||||
motionOnHide:false,
|
||||
fx: { 'duration': '100' }
|
||||
});
|
||||
|
||||
tipDiv.on('click', function(e) {
|
||||
tipDiv.trigger('mouseleave', e);
|
||||
});
|
||||
},
|
||||
|
||||
_buildContent : function() {
|
||||
var result = new Element('div');
|
||||
result.setStyles({
|
||||
var result = $('<div></div>');
|
||||
result.css({
|
||||
padding:'3px 0px',
|
||||
width:'100%'
|
||||
});
|
||||
|
||||
var textContainer = new Element('div', {text:this._text});
|
||||
textContainer.setStyles({
|
||||
var textContainer = $('<div></div>').text(this._text);
|
||||
textContainer.css({
|
||||
width: '100%',
|
||||
textAlign: 'center',
|
||||
'font-weight':'bold'
|
||||
});
|
||||
|
||||
textContainer.inject(result);
|
||||
result.append(textContainer);
|
||||
return result;
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue
Block a user