raix:ui-dropped-event

v0.0.7Published 10 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

Installation

$ cd <app dir>
$ meteor add raix:ui-dropped-event

ui-dropped-event

Adds the dropped event.

1  Template.foo.events({
2    'dropped #bar': function(e, t) {
3    }
4  });

####Short example:

Template

1  <div id="dropzone" class="dropzone">
2    <div style="text-align: center; color: gray;">Drop file to upload</div>
3  </div>

Javascript

1  Template.hello.events({
2    // Catch the dropped event
3    'dropped #dropzone': function(event, temp) {
4      console.log('files droped');
5
6      // If using the cfs api
7      FS.Utility.eachFile(event, function(file) {
8        var id = images.insert(file);
9        console.log('Inserted file ');
10        console.log(id);
11      });
12    }
13  });