keep the flip op to the end of the op list
This commit is contained in:
parent
66da2789b2
commit
8e44d3fdb0
2 changed files with 15 additions and 0 deletions
|
|
@ -22,6 +22,15 @@ if (!AP.flat) {
|
|||
};
|
||||
}
|
||||
|
||||
AP.find = function(fn) {
|
||||
for (let i=0, l=this.length; i<l; i++) {
|
||||
if (fn(this[i])) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
|
||||
AP.equals = function(arr) {
|
||||
if (!arr) return false;
|
||||
if (arr.length !== this.length) return false;
|
||||
|
|
|
|||
|
|
@ -262,6 +262,11 @@ CAM.init = function(kiri, api) {
|
|||
let oplist = current.process.ops;
|
||||
if (oplist.indexOf(rec) < 0) {
|
||||
oplist.push(rec);
|
||||
let fpos = oplist.find(rec => rec.type === 'flip');
|
||||
if (fpos >= 0 && oplist.length > 1) {
|
||||
let oprec = oplist.splice(fpos,1);
|
||||
oplist.push(oprec[0]);
|
||||
}
|
||||
API.conf.save();
|
||||
func.opRender();
|
||||
}
|
||||
|
|
@ -283,6 +288,7 @@ CAM.init = function(kiri, api) {
|
|||
// $('camops').style.display = isCamMode && isArrange ? 'flex' : '';
|
||||
let oplist = current.process.ops;
|
||||
if (!(isCamMode && oplist)) return;
|
||||
oplist = oplist.filter(rec => !Array.isArray(rec));
|
||||
let mark = Date.now();
|
||||
let html = [];
|
||||
$('ophint').style.display = oplist.length === 0 ? '' : 'none';
|
||||
|
|
|
|||
Loading…
Reference in a new issue