mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-12-22 19:53:49 +01:00
Merged in bugfix/undo-delete-and-tooltips (pull request #12)
Bugfix/undo delete and tooltips * Fix undo delete: restore NodeModel original-like implementation * Fix empty tooltips (no text) Approved-by: Paulo Veiga
This commit is contained in:
parent
f8156fcf85
commit
60771b2ded
@ -122,7 +122,16 @@ class NodeModel extends INodeModel {
|
||||
* @return {mindplot.model.NodeModel} an identical clone of the NodeModel
|
||||
*/
|
||||
clone() {
|
||||
return cloneDeep(this);
|
||||
const result = new NodeModel(this.getType(), this._mindmap);
|
||||
result._children = this._children.map((node) => {
|
||||
const cnode = node.clone();
|
||||
cnode._parent = result;
|
||||
return cnode;
|
||||
});
|
||||
|
||||
result._properties = cloneDeep(this._properties);
|
||||
result._feature = cloneDeep(this._feature);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -31,20 +31,19 @@ class KeyboardShortcutTooltip extends FloatingTip {
|
||||
buttonElem.append(tipDiv);
|
||||
|
||||
super(tipDiv, {
|
||||
// Content can also be a function of the target element!
|
||||
content: KeyboardShortcutTooltip._buildContent(),
|
||||
// content can be a function or string
|
||||
content: KeyboardShortcutTooltip._buildContent(text),
|
||||
html: true,
|
||||
placement: 'bottom',
|
||||
className: 'keyboardShortcutTip',
|
||||
template: '<div class="popover popoverBlack" role="tooltip"><div class="arrow arrowBlack"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>',
|
||||
});
|
||||
this._text = text;
|
||||
tipDiv.on('click', (e) => {
|
||||
tipDiv.trigger('mouseleave', e);
|
||||
});
|
||||
}
|
||||
|
||||
static _buildContent() {
|
||||
static _buildContent(text) {
|
||||
const result = $('<div></div>');
|
||||
result.css({
|
||||
padding: '3px 0px',
|
||||
@ -52,7 +51,7 @@ class KeyboardShortcutTooltip extends FloatingTip {
|
||||
color: 'white',
|
||||
});
|
||||
|
||||
const textContainer = $('<div></div>').text(this._text);
|
||||
const textContainer = $('<div></div>').text(text);
|
||||
textContainer.css({
|
||||
width: '100%',
|
||||
'font-size': '90%',
|
||||
|
Loading…
Reference in New Issue
Block a user