skip catalog for grouped objects

This commit is contained in:
Stewart Allen 2021-12-07 18:28:49 -05:00
commit 83bbf16768
2 changed files with 9 additions and 15 deletions

View file

@ -1335,22 +1335,12 @@
return API.platform.load_files(files, undefined);
}
function ck_group() {
if (files.length === 1) {
API.platform.load_files(files);
} else {
UC.confirm(`group ${files.length} files?`).then(yes => {
API.platform.load_files(files, yes ? [] : undefined);
});
}
}
if (files.length > 5) {
UC.confirm(`add ${files.length} objects to workspace?`).then(yes => {
if (yes) ck_group();
});
if (files.length === 1) {
API.platform.load_files(files);
} else {
ck_group();
UC.confirm(`group ${files.length} files?`).then(yes => {
API.platform.load_files(files, yes ? [] : undefined);
});
}
}

View file

@ -139,6 +139,7 @@ console.log/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
*/
function Widget(id, group) {
this.id = id || new Date().getTime().toString(36)+(nextId++);
this.grouped = group ? true : false;
this.group = group || [];
this.group.push(this);
if (!this.group.id) {
@ -249,6 +250,9 @@ console.log/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
******************************************************************* */
PRO.saveToCatalog = function(filename) {
if (this.grouped) {
return this;
}
let widget = this;
let time = UTIL.time();
widget.meta.file = filename;