fix module load order. fix none/all selection for undo/redo. fix button show based on mode
This commit is contained in:
parent
ee68006d2c
commit
6083543c12
3 changed files with 10 additions and 4 deletions
2
app.js
2
app.js
|
|
@ -254,6 +254,7 @@ const script = {
|
|||
"moto/load-url",
|
||||
"moto/db",
|
||||
"kiri/ui",
|
||||
"kiri/do",
|
||||
"kiri/lang",
|
||||
"kiri/lang-en",
|
||||
"kiri/catalog",
|
||||
|
|
@ -280,7 +281,6 @@ const script = {
|
|||
"kiri/init",
|
||||
"kiri/export",
|
||||
"kiri/tools",
|
||||
"kiri/do",
|
||||
"@devices",
|
||||
"@icons"
|
||||
].map(p => p.charAt(0) !== '@' ? `src/${p}.js` : p),
|
||||
|
|
|
|||
|
|
@ -37,7 +37,8 @@ kiri.load(function(API) {
|
|||
};
|
||||
|
||||
function updateButtons() {
|
||||
$('doit').style.display = stack.length ? '' : 'none';
|
||||
let isArrange = API.view.get() === API.const.VIEWS.ARRANGE;
|
||||
$('doit').style.display = isArrange && stack.length ? 'flex' : 'none';
|
||||
$('undo').disabled = stpos === 0;
|
||||
$('redo').disabled = stpos == stack.length;
|
||||
}
|
||||
|
|
@ -86,6 +87,10 @@ kiri.load(function(API) {
|
|||
clear();
|
||||
});
|
||||
|
||||
event.on('view.set', mode => {
|
||||
updateButtons();
|
||||
});
|
||||
|
||||
// selection event (store position)
|
||||
event.on('widget.rotate', (rec) => {
|
||||
let type = "rotate";
|
||||
|
|
@ -113,7 +118,7 @@ kiri.load(function(API) {
|
|||
if (Math.abs(1 - (x * y * z)) < 0.0001) {
|
||||
return;
|
||||
}
|
||||
let widgets = API.selection.widgets();
|
||||
let widgets = API.selection.widgets(true);
|
||||
let type = "scale";
|
||||
pushActions({
|
||||
redo: {
|
||||
|
|
@ -137,7 +142,7 @@ kiri.load(function(API) {
|
|||
|
||||
// move complete (store updated position)
|
||||
event.on('mouse.drag.done', () => {
|
||||
let widgets = API.selection.widgets();
|
||||
let widgets = API.selection.widgets(true);
|
||||
let type = "move";
|
||||
pushActions({
|
||||
redo: {
|
||||
|
|
|
|||
|
|
@ -344,6 +344,7 @@ th, tr, td, label {
|
|||
}
|
||||
|
||||
#doit {
|
||||
display: none;
|
||||
position: absolute;
|
||||
white-space: nowrap;
|
||||
font-size: smaller;
|
||||
|
|
|
|||
Loading…
Reference in a new issue