fix sync option

This commit is contained in:
kekee000 2016-04-21 22:01:17 +08:00
parent b9b10a3a38
commit f79537765b
5 changed files with 11 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,7 @@
border-bottom: #353D45 1px solid; border-bottom: #353D45 1px solid;
.btn { .btn {
padding-left: 12px; padding-left: 10px;
padding-right: 12px; padding-right: 12px;
} }

View File

@ -40,6 +40,7 @@ exports.getProcessors = function () {
files: [ files: [
'src/fonteditor/main.js', 'src/fonteditor/main.js',
'dep/**/*.js', 'dep/**/*.js',
'!dep/**/*.min.js',
] ]
}), }),

View File

@ -158,7 +158,12 @@ define(
config: config config: config
}); });
}, },
'dosync': function (projectId) {
var syncConfig = program.project.getConfig(projectId).sync;
if (syncConfig && syncConfig.autoSync) {
actions.sync(projectId, program.ttfManager.get(), syncConfig);
}
},
'save': function (options) { 'save': function (options) {
if (program.ttfManager.get()) { if (program.ttfManager.get()) {
// 已经保存过的项目 // 已经保存过的项目
@ -168,10 +173,7 @@ define(
.then(function () { .then(function () {
program.ttfManager.setState('saved'); program.ttfManager.setState('saved');
program.loading.show(i18n.lang.msg_save_success, 400); program.loading.show(i18n.lang.msg_save_success, 400);
var syncConfig = program.project.getConfig(projectId).sync; actions['dosync'](projectId);
if (syncConfig && syncConfig.autoSync) {
actions.sync(projectId, program.ttfManager.get(), syncConfig);
}
}, function () { }, function () {
program.loading.show(i18n.lang.msg_save_failed, 1000); program.loading.show(i18n.lang.msg_save_failed, 1000);
}); });

View File

@ -531,7 +531,7 @@ define(
program.viewer.focus(); program.viewer.focus();
}) })
.on('sync', function (e) { .on('sync', function (e) {
actions.sync(e.projectId); actions['dosync'](e.projectId);
}) })
.on('del', function (e) { .on('del', function (e) {
program.project.remove(e.projectId).then(function () { program.project.remove(e.projectId).then(function () {