diff --git a/kodbox-plugins/drawio/static/images/drawio.png b/kodbox-plugins/drawio/static/images/drawio.png new file mode 100755 index 0000000..fe5b31c Binary files /dev/null and b/kodbox-plugins/drawio/static/images/drawio.png differ diff --git a/kodbox-plugins/drawio/static/main.js b/kodbox-plugins/drawio/static/main.js index e04bc60..caad999 100644 --- a/kodbox-plugins/drawio/static/main.js +++ b/kodbox-plugins/drawio/static/main.js @@ -22,38 +22,30 @@ kodReady.push(function() { 'newDraw': { name: "{{LNG['drawio.file.name']}}", className: "newDraw", - icon: "{{pluginHost}}static/images/icon.png", + icon: "{{pluginHost}}static/images/drawio.png", callback: function() { - kodApp.pathAction.newFile('drawio'); + //kodApp.pathAction.newFile('drawio'); + if(typeof(kodApp.root.pathAction)=="undefined"){ + kodApp.pathAction.newFile('drawio'); + } else { + kodApp.root.pathAction.newFile('drawio'); + } + //window.kodApp.root.pathAction.newFile('drawio'); + //alert(kodApp.root.pathAction.makeParamItem().name); } } } - // 文件夹空白右键菜单 - Events.bind( - 'rightMenu.beforeShow@.menu-path-body', function(menu, menuType) { + function menuLoad(menu, menuType) { if (menu.extendNewDraw) return; $.contextMenu.menuAdd(newDrawMenu, menu, false, '.new-file-docx'); menu.extendNewDraw = true; - }); + } + // 文件夹空白右键菜单 + Events.bind('rightMenu.beforeShow@.menu-path-body', menuLoad); // 桌面右键菜单 - Events.bind( - 'rightMenu.beforeShow@.menu-desktop', function(menu, menuType) { - if (menu.extendNewDraw) return; - $.contextMenu.menuAdd(newDrawMenu, menu, false, '.new-file-docx'); - menu.extendNewDraw = true; - }); + Events.bind('rightMenu.beforeShow@.menu-desktop', menuLoad); // 本地路径目录空白右键菜单 - Events.bind( - 'rightMenu.beforeShow@.menu-path-guest-body', function(menu, menuType) { - if (menu.extendNewDraw) return; - $.contextMenu.menuAdd(newDrawMenu, menu, false, '.new-file-docx'); - menu.extendNewDraw = true; - }); + Events.bind('rightMenu.beforeShow@.menu-path-guest-body', menuLoad); // 工具栏“新建更多”菜单 - Events.bind( - 'rightMenu.beforeShow@.menu-toolbar-new-file-others', function(menu, menuType) { - if (menu.extendNewDraw) return; - $.contextMenu.menuAdd(newDrawMenu, menu, false, '.new-file-docx'); - menu.extendNewDraw = true; - }); + Events.bind('rightMenu.beforeShow@.menu-toolbar-new-file-others', menuLoad); }); \ No newline at end of file diff --git a/kodexplorer-plugins/drawio/static/images/drawio.png b/kodexplorer-plugins/drawio/static/images/drawio.png new file mode 100755 index 0000000..fe5b31c Binary files /dev/null and b/kodexplorer-plugins/drawio/static/images/drawio.png differ diff --git a/kodexplorer-plugins/drawio/static/main.js b/kodexplorer-plugins/drawio/static/main.js index f676457..25d1c1b 100644 --- a/kodexplorer-plugins/drawio/static/main.js +++ b/kodexplorer-plugins/drawio/static/main.js @@ -20,7 +20,7 @@ kodReady.push(function() { 'newDraw': { name: "{{LNG.drawio.file.name}}", className: "newDraw", - icon: "{{pluginHost}}static/images/icon.png", + icon: "{{pluginHost}}static/images/drawio.png", callback: function() { ui.path.newFile('drawio'); } @@ -30,4 +30,6 @@ kodReady.push(function() { $.contextMenu.menuAdd(newDrawMenu, '.menu-body-main', false, 'newfile-docx'); // 工具栏“新建更多”菜单 $.contextMenu.menuAdd(newDrawMenu, ".tool-path-newfile", false, "newfile-docx"); + // 桌面模式右键菜单 + $.contextMenu.menuAdd(newDrawMenu, ".bodymain", false, "newfile-docx"); }); \ No newline at end of file