Skip to content

Commit

Permalink
1. 增加调试快捷键;2. 修复初始化时没有检测安装包的问题;
Browse files Browse the repository at this point in the history
  • Loading branch information
kayo5994 committed Oct 9, 2016
1 parent 03767ae commit 2a2a057
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
"main": "main.js",
"scripts": {
"start": "electron main.js",
"build:mac": "electron-packager ./ QMUI --platform=darwin --arch=x64 --icon=./images/logo.icns --overwrite --out ./dist/$npm_package_version --version=0.37.8 --ignore='(node_modules/electron-*|node_modules/.bin|.git|.DS_Store|dist)'",
"build:win": "electron-packager ./ QMUI --platform=win32 --arch=x64 --icon=./images/logo.ico --overwrite --out ./dist/$npm_package_version --version=0.37.8 --ignore='(node_modules/electron-*|node_modules/.bin|.git|.DS_Store|dist)'"
"build:mac": "electron-packager ./ QMUI --platform=darwin --arch=x64 --icon=./images/logo.icns --overwrite --out ./dist/$npm_package_version --ignore='(node_modules/electron-*|node_modules/.bin|.git|.DS_Store|dist)'",
"build:win": "electron-packager ./ QMUI --platform=win32 --arch=x64 --icon=./images/logo.ico --overwrite --out ./dist/$npm_package_version --ignore='(node_modules/electron-*|.git|.DS_Store|dist)'"
},
"devDependencies": {
"asar": "^0.12.3",
"electron-packager": "^8.1.0",
"electron-prebuilt": "^1.4.3",
"electron-packager": "^7.7.0",
"electron-prebuilt": "^1.3.4"
},
"dependencies": {
"lodash": "^4.16.4"
},
"author": "QMUI Team",
Expand Down
14 changes: 14 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,20 @@ function initData() {
$curProject = $projectList.find('.js_project_item').eq(0);
$curProject.addClass('project_stage_item_Current');

let projectPath = $curProject.attr('title');
let qmuiModulePath = projectPath + '/UI_dev/qmui_web/node_modules';
if (!fs.existsSync(qmuiModulePath)) {
$gulpButton.addClass('qw_hide');
$mergeButton.addClass('qw_hide');
$cleanButton.addClass('qw_hide');
$installButton.removeClass('qw_hide');
} else {
$gulpButton.removeClass('qw_hide');
$mergeButton.removeClass('qw_hide');
$cleanButton.removeClass('qw_hide');
$installButton.addClass('qw_hide');
}

// 复制一份数据到 sessionStorage,方便后续使用
Common.setSessionStorage(storage);

Expand Down
2 changes: 2 additions & 0 deletions src/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,14 @@ var template = [
submenu: [
{
label: '开启/关闭调试工具',
accelerator: 'CmdOrCtrl+D',
click: function () {
remote.getCurrentWebContents().toggleDevTools();
}
},
{
label: '重置储存数据',
accelerator: 'CmdOrCtrl+shift+R',
click: function () {
resetAppStorage();
}
Expand Down

0 comments on commit 2a2a057

Please sign in to comment.