add history debounce
This commit is contained in:
@@ -197,6 +197,11 @@ define(
|
||||
*/
|
||||
function bindViewer(program) {
|
||||
|
||||
// 由于可能存在连续保存的情况,这里debounce一下
|
||||
var pushHistory = lang.debounce(function () {
|
||||
program.ttfManager.pushHistory();
|
||||
}, 200);
|
||||
|
||||
program.viewer.on('del', function (e) {
|
||||
if (e.list) {
|
||||
program.ttfManager.removeGlyf(e.list);
|
||||
@@ -358,9 +363,7 @@ define(
|
||||
var selected = program.viewer.getSelected();
|
||||
if (selected.length) {
|
||||
moveSelectedGlyf(selected, true);
|
||||
setTimeout(function () {
|
||||
program.ttfManager.pushHistory();
|
||||
});
|
||||
pushHistory();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -381,9 +384,7 @@ define(
|
||||
var selected = program.viewer.getSelected();
|
||||
if (selected.length) {
|
||||
moveSelectedGlyf(selected, false);
|
||||
setTimeout(function () {
|
||||
program.ttfManager.pushHistory();
|
||||
});
|
||||
pushHistory();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -213,7 +213,7 @@ define(
|
||||
unicodes = [glyf.unicode];
|
||||
}
|
||||
|
||||
if (lang.isArray(unicodes)) {
|
||||
if (Array.isArray(unicodes)) {
|
||||
unicodes.forEach(function (unicode) {
|
||||
if (unicode !== 0xFFFF) {
|
||||
usFirstCharIndex = Math.min(usFirstCharIndex, unicode);
|
||||
|
||||
@@ -539,7 +539,7 @@ define(
|
||||
|
||||
// 按unicode数组查找
|
||||
if (condition.unicode) {
|
||||
var unicodeList = lang.isArray(condition.unicode) ? condition.unicode : [condition.unicode];
|
||||
var unicodeList = Array.isArray(condition.unicode) ? condition.unicode : [condition.unicode];
|
||||
var unicodeHash = {};
|
||||
unicodeList.forEach(function (unicode) {
|
||||
if (typeof unicode === 'string') {
|
||||
|
||||
Reference in New Issue
Block a user