Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolves #3660 use the asset directory attribute on the node to resolve the asset path #3661

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ggrossetie
Copy link
Member

@ggrossetie ggrossetie commented May 17, 2020

By default, the asset directory is imagesdir or iconsdir depending on the type of asset.

If the asset directory attribute is defined on the node then we use it.
Otherwise, we use the value defined on the Document.

I've decided to apply the same rule on all type of assets (video, audio, icon and image). I think it would be inconsistent and confusing to implement this behavior only on images.

resolves #3660

@ggrossetie ggrossetie force-pushed the issue-3660-assetdir-attr-node branch from 8c4a89f to 40a9b62 Compare May 17, 2020 12:02
@ggrossetie ggrossetie changed the title resolves #3660 first use the asset directory attribute on the node resolves #3660 use the asset directory attribute on the node to resolve the asset path May 17, 2020
@@ -309,16 +309,17 @@ def icon_uri name
#
# Returns A String reference or data URI for the target image
def image_uri(target_image, asset_dir_key = 'imagesdir')
images_base = asset_dir_key ? (attr asset_dir_key, nil, true) : nil
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this variable is used in both branches so I've decided to declare it above

@ggrossetie ggrossetie force-pushed the issue-3660-assetdir-attr-node branch 2 times, most recently from 50f0016 to bdad32c Compare May 17, 2020 12:12
…de to resolve the asset path

If the asset directory attribute (by default, `imagesdir` or `iconsdir`) is defined on the node, we should use it.
If not, then we should use the value defined on the `Document`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Look for imagesdir attribute on node before looking on document
2 participants