mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-11 01:43:23 +01:00
Fix clean up code.
This commit is contained in:
parent
1d7db72ae5
commit
d8cdb50558
@ -38,7 +38,18 @@ class Menu extends IMenu {
|
||||
const widgetsBaseUrl = `${baseUrl}css/widget`;
|
||||
|
||||
// Create panels ...
|
||||
|
||||
const designerModel = designer.getModel();
|
||||
const backTolist = $('#backToList');
|
||||
backTolist.bind('click', (event) => {
|
||||
event.stopPropagation();
|
||||
window.location.href = '/c/maps/';
|
||||
return false;
|
||||
});
|
||||
Menu._registerTooltip('backToList', $msg('BACK_TO_MAP_LIST'));
|
||||
|
||||
|
||||
if (!readOnly) {
|
||||
const fontFamilyModel = {
|
||||
getValue() {
|
||||
const nodes = designerModel.filterSelectedTopics();
|
||||
@ -179,25 +190,6 @@ class Menu extends IMenu {
|
||||
this._toolbarElems.push(new ColorPalettePanel('fontColor', fontColorModel, baseUrl));
|
||||
Menu._registerTooltip('fontColor', $msg('FONT_COLOR'));
|
||||
|
||||
Menu._registerTooltip('export', $msg('EXPORT'));
|
||||
|
||||
Menu._registerTooltip('print', $msg('PRINT'));
|
||||
|
||||
this._addButton('zoom-plus', false, false, () => {
|
||||
designer.zoomIn();
|
||||
});
|
||||
Menu._registerTooltip('zoom-plus', $msg('ZOOM_IN'));
|
||||
|
||||
this._addButton('zoom-minus', false, false, () => {
|
||||
designer.zoomOut();
|
||||
});
|
||||
Menu._registerTooltip('zoom-minus', $msg('ZOOM_OUT'));
|
||||
|
||||
this._addButton('position', false, false, () => {
|
||||
designer.zoomToFit();
|
||||
});
|
||||
Menu._registerTooltip('position', $msg('CENTER_POSITION'));
|
||||
|
||||
const undoButton = this._addButton('undoEdition', false, false, () => {
|
||||
designer.undo();
|
||||
});
|
||||
@ -264,6 +256,7 @@ class Menu extends IMenu {
|
||||
});
|
||||
Menu._registerTooltip('fontItalic', $msg('FONT_ITALIC'), 'meta+I');
|
||||
|
||||
|
||||
if (saveElem) {
|
||||
this._addButton('save', false, false,
|
||||
() => {
|
||||
@ -289,6 +282,11 @@ class Menu extends IMenu {
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Menu._registerTooltip('export', $msg('EXPORT'));
|
||||
|
||||
Menu._registerTooltip('print', $msg('PRINT'));
|
||||
|
||||
const shareElem = $('#shareIt');
|
||||
if (shareElem.length !== 0) {
|
||||
@ -316,14 +314,6 @@ class Menu extends IMenu {
|
||||
Menu._registerTooltip('keyboardShortcuts', $msg('KEYBOARD_SHOTCUTS'));
|
||||
}
|
||||
|
||||
const backTolist = $('#backToList');
|
||||
backTolist.bind('click', (event) => {
|
||||
event.stopPropagation();
|
||||
window.location.href = '/c/maps/';
|
||||
return false;
|
||||
});
|
||||
Menu._registerTooltip('backToList', $msg('BACK_TO_MAP_LIST'));
|
||||
|
||||
// Account dialog ...
|
||||
const accountSettings = $('#account');
|
||||
if (accountSettings.length !== 0) {
|
||||
|
@ -55,6 +55,8 @@ export default function Toolbar({
|
||||
</ToolbarButton>
|
||||
</div>
|
||||
)}
|
||||
{(editorMode === 'edition-editor' || editorMode === 'edition-owner' || editorMode === 'showcase') && (
|
||||
<>
|
||||
<div id="edit" className="buttonContainer">
|
||||
<ToolbarButton id="undoEdition" className="buttonOn">
|
||||
<img src={UndoSvg} />
|
||||
@ -112,6 +114,8 @@ export default function Toolbar({
|
||||
</ToolbarButton>
|
||||
</div>
|
||||
<div id="separator" className="buttonContainer"></div>
|
||||
</>
|
||||
)}
|
||||
<ToolbarRightContainer>
|
||||
<ToolbarButton
|
||||
id="export"
|
||||
|
Loading…
Reference in New Issue
Block a user