jaysalvat / ezdz

A jQuery plugin to turn any standard input type file into a nice drag & drop zone with validators and previews.
MIT License
89 stars 36 forks source link

bgPreview and toggleItems #4

Closed AbbyJanke closed 10 years ago

AbbyJanke commented 10 years ago

Added bgPreview and toggleItems options.

bgPreview: Instead of just displaying the main preview, allow it to change the background instead. (Does not require previewImage to be true)

toggleItems: toggle classes on specific items, great for only showing the upload button once item.

$('[type="file"]').ezdz({
        bgPreview:  '.backgroundPreview',
        toggleItems: {
            '.uploadButton': 'hidden',
            '.jumbotron':    'transparent',
        },
    });
AbbyJanke commented 10 years ago

Sorry for all the different commits! Had some minor things to fixup and add documentation. :)

jaysalvat commented 10 years ago

Hi ! A big thank for your contribution!

However, I won't merge it. These features are too specifics and I want the plugin to remain as simple as possible. Those actions can be made by the developer in the callback with better control if he really needs them :)

Thanks anyway AbbyLynn!