/
githubmirror
/
drawio
Обзор
Документация
Войти
/
githubmirror
/
drawio
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
src/main/webapp/plugins/explore.js
45 строк
1 KB
David Benson
28.2.0 release
05 сен 2025, 20:29
05 сен 2025, 20:29
947271f
Код
Авторство
О чём код?
/** * Copyright (c) 2020-2025, JGraph Holdings Ltd * Copyright (c) 2020-2025, draw.io AG */ /** * Explore plugin. */ Draw.loadPlugin(function(ui) { // Adds resource for action mxResources.parse('exploreFromHere=Explore from here...'); var uiCreatePopupMenu = ui.menus.createPopupMenu; ui.menus.createPopupMenu = function(menu, cell, evt) { uiCreatePopupMenu.apply(this, arguments); var graph = ui.editor.graph; if (graph.getEdges(graph.getSelectionCell()).length > 0) { this.addMenuItems(menu, ['-', 'exploreFromHere'], null, evt); } }; // Adds action ui.actions.addAction('exploreFromHere', function() { Graph.exploreFromCell(ui.editor.graph, ui.editor.graph.getSelectionCell()); }); // Click handler for chromeless mode if (ui.editor.isChromelessView()) { ui.editor.graph.click = function(me) { if (ui.editor.graph.model.isVertex(me.getCell()) && ui.editor.graph.model.getEdgeCount(me.getCell()) > 0 && this.getLinkForCell(me.getCell()) == null) { Graph.exploreFromCell(ui.editor.graph, me.getCell()); } }; } });