Commit c725af75 by liuyong

修改画布

1 parent 8937b9ce
Showing with 29 additions and 44 deletions
var exToolbar = function (toolbarContainer) {
this.toggleElement = document.createElement('a');
this.toggleElement.setAttribute('title', '版本发布');
this.toggleElement.style.position = 'absolute';
this.toggleElement.style.display = 'inline-block';
this.toggleElement.style.width = '100px';
this.toggleElement.style.height = '16px';
this.toggleElement.style.color = '#666';
this.toggleElement.style.top = '6px';
this.toggleElement.style.right = '10px';
this.toggleElement.style.padding = '2px';
this.toggleElement.style.fontSize = '14px';
this.toggleElement.style.textDecoration = 'none';
this.toggleElement.text = '版本发布';
this.toggleElement.style.marginRight = '100px';
this.toggleElement.style.cursor = 'pointer';
this.toggleElement.style.color = 'rgb(13,134,127)';
this.toggleElement.style.backgroundPosition = '50% 50%';
this.toggleElement.style.backgroundRepeat = 'no-repeat';
// Prevents focus
mxEvent.addListener(this.toggleElement, (mxClient.IS_POINTER) ? 'pointerdown' : 'mousedown',
mxUtils.bind(this, function (evt) {
evt.preventDefault();
}));
// Toggles compact mode
mxEvent.addListener(this.toggleElement, 'click', mxUtils.bind(this, function (evt) {
window.parent.postMessage({ type: 'saveVersion' }, '*');
}));
if (Editor.currentTheme != 'atlas') {
toolbarContainer.appendChild(this.toggleElement);
function lookCurrentDetailsMenu(that, graph, menu, evt) {//添加下钻数据按钮
if (!graph.isSelectionEmpty())
{
that.addMenuItems(menu, ['-', 'lookCurrentDetails'], null, evt);
}
}
// Enable compact mode for small screens except for Firefox where the height is wrong
if (!mxClient.IS_FF && screen.height <= 740 && typeof this.toggleElement.click !== 'undefined') {
window.setTimeout(mxUtils.bind(this, function () {
this.toggleElement.click();
}), 0);
}
function lookCurrentDetailsMenuAction(editorUi, graph) {//下钻数据按钮点击操作
editorUi.actions.addAction('lookCurrentDetails', function(evt)
{
editorUi.spinner.spin(document.body, mxResources.get('loading'));
// if (!graph.isSelectionEmpty())
// {
// console.log('下钻数据')
// const mockFile = {
// data: `<mxGraphModel dx="1177" dy="690" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
// <root>
// <mxCell id="0"/>
// <mxCell id="1" parent="0"/>
// </root>
// </mxGraphModel>`,
// title: '下钻数据'
// }
// editorUi.editor.setStatus('');
// editorUi.fileLoaded(null);
// editorUi.spinner.stop();
// const file = new LocalFile(editorUi, mockFile.data, mockFile.title, null);
// editorUi.fileLoaded(file);
// }
});
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!