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

[proposal] storing diferrent directives for a single image #3

Open
tcastelli opened this issue Oct 16, 2015 · 2 comments
Open

[proposal] storing diferrent directives for a single image #3

tcastelli opened this issue Oct 16, 2015 · 2 comments
Labels

Comments

@tcastelli
Copy link

No description provided.

@tcastelli
Copy link
Author

I just saw that there's also an implementation for this, but it gives me an error with multi:false (since i only want a single image as profile picture for example)

 type: [afSlingshot.fileSchema],
    optional: true,
    autoform: {
      type: 'slingshot', // (required)
      multi: true,
      ui: {
        showDownload: true
      },
      slingshot: {
        directives: [
          {
            name: "thumbnails",
            onBeforeUpload: function(file, callback) {
              var settings = {
                width: 1024,
                height: 1024,
                cropSquare: false
              };
              Resizer.resize( file, settings, callback );
            }
          },{
            name: 'files'
          }
        ],
      }
    }
  },

@tcastelli tcastelli reopened this Oct 16, 2015
@tcastelli tcastelli changed the title [proposal] storing diferrent directives in the the document [proposal] storing diferrent directives for a single image Oct 16, 2015
@jimmiebtlr
Copy link
Contributor

Actually, try it with

type: [afSlingshot.fileSchema],
autoform: {
  ui: {
    hideList: true,
    multipleUpload: false
  },
  slingshot: {
    replaceOnChange: true
  }
}

and whatever directives you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants