Is there a property that says if the artboard is an overlay? I can probably check the incoming interactions and see that way.
https://adobexdplatform.com/plugin-docs/reference/interactions.html#interactions
Is there a property that says if the artboard is an overlay? I can probably check the incoming interactions and see that way.
https://adobexdplatform.com/plugin-docs/reference/interactions.html#interactions
In what case would an artboard be used as an overlay?
When you run Desktop Preview I’m seeing use cases where an artboard is used as a pop up.
In the Responsive Design UIKit the last artboard is an overlay.
I think I’ve sort of got it working with this:
/**
* Returns true if the artboard is an overlay to another artboard
* @param {Artboard} item
* @return {Boolean}
**/
function isArtboardOverlay(item) {
var interactions = null;
try {
interactions = item.incomingInteractions;
for (let index = 0; index < interactions.length; index++) {
var interaction = interactions[index];
var localInteractions = interaction.interactions;
for (let j = 0; j < localInteractions.length; j++) {
const localInteraction = localInteractions[j];
var trigger = localInteraction.trigger;
var action = localInteraction.action;
if (trigger && trigger.type==TriggerType.TAP && action && action.type==ActionType.OVERLAY) {
return true;
}
}
}
return false;
}
catch(error) {
log(error.stack);
// when an interaction(s) is added to an node and one does not have an endpoint the following errors happen
// Plugin TypeError: Cannot read property 'pluginWrapper' of null
// at Interaction.serializeForApi (lib/interactions/Interaction.js:1:11398)
// at forEach.e (plugins/ScenegraphWrappers.js:1:11918)
// at Array.forEach (<anonymous>)
// at Text.get (plugins/ScenegraphWrappers.js:1:11896)
return false;
}
}
@Velara yep! That’s your best bet – there’s nothing special about an artboard that’s used as an overlay. Its only distinguishing characteristic is that some interaction exists somewhere in the document which uses it in that capacity.