Skip to content

Commit 30e4de8

Browse files
committed
Add a warning if many elements
1 parent 80738ce commit 30e4de8

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/explode_shape_layer.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
var contents = layer.property("Contents");
2424
var n_layers = [];
2525

26+
if(contents.numProperties > configs.itemAmountWarning && !confirm('You have more than ' + configs.itemAmountWarning + ' elements. Execution time might be long, are you sure you want to continue ?'))
27+
return;
28+
29+
2630
// Browse through contents array
2731
for(var i = contents.numProperties; i > 0; i--) {
2832

@@ -222,7 +226,8 @@ function consLog(text) { if (configs.log) $.writeln(text); }
222226

223227
var configs = {
224228
title: 'Explode layer tool',
225-
log : true,
229+
log : false,
230+
itemAmountWarning : 50,
226231
};
227232

228233
var myToolsPanel = createUI(this);

0 commit comments

Comments
 (0)