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

Add ability to set asset name based on the Image filename #9391

Open
baditaflorin opened this issue Apr 3, 2021 · 0 comments
Open

Add ability to set asset name based on the Image filename #9391

baditaflorin opened this issue Apr 3, 2021 · 0 comments

Comments

@baditaflorin
Copy link

Is your feature request related to a problem? Please describe.
I think it would be a useful workflow for when you want to add multiple products, you already have the photos of the asset with the same name as the asset.

Describe the solution you'd like
Something like this


function waitForElm(selector) {
  return new Promise(resolve => {
      if (document.querySelector(selector)) {
          return resolve(document.querySelector(selector));
      }

      const observer = new MutationObserver(mutations => {
          if (document.querySelector(selector)) {
              resolve(document.querySelector(selector));
              observer.disconnect();
          }
      });

      observer.observe(document.body, {
          childList: true,
          subtree: true
      });
  });
}

waitForElm("#uploadFile-info > span").then(elm => document.querySelector("#name").value = elm.textContent);

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

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

No branches or pull requests

1 participant