Add dropped event to Meteor UI Templates
Clone or download
Latest commit 68e4289 Dec 17, 2014

README.md

Installation

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

ui-dropped-event

Adds the dropped event.

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

####Short example:

Template

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

Javascript

  Template.hello.events({
    // Catch the dropped event
    'dropped #dropzone': function(event, temp) {
      console.log('files droped');

      // If using the cfs api
      FS.Utility.eachFile(event, function(file) {
        var id = images.insert(file);
        console.log('Inserted file ');
        console.log(id);
      });
    }
  });