Problem with drag and drop to Meteor

I was just starting to learn Meteor (and Templating). I still like it. However, I ran into a strange problem using my own drag5 variables in HTML5 on the table. Please note that I'm not using jQuery events.

I have a table with droppable tdand draggable elements.

So my template is tableas follows:

<template name="table">
<table>
  {{#each row}}
     <tr>
        {{#each col}}
           <td>
             {{#each elements}}
               {{>element}}
             {{/each}}
            </td>
        {{/each}}
     </tr>
   {{/each}}
</table>
</template>
Template.tasktable.events({
  'dragover td': function(evt) {
    evt.preventDefault();
  },
  'drop td': function(evt) {
    evt.preventDefault();
    var id = evt.dataTransfer.getData('Text');
    Collection.update({_id: id}, {$set: {value: this.value}});
  }
});

Then my template elementlooks like this:

<template name="element">
  <div draggable="true">{{value}}</div>
</template>
Template.element.events({
  'dragstart': function(evt, tmpl) {
     evt.dataTransfer.setData('Text', this._id);
  }
});

For some reason, hiding my brain, the event is drag overfollowed by a rendering event , as you can see in the image of the dev tool here: http://cl.ly/image/3O1S2d1j1f1a

, dragover , drop . , , , domutils.js.

, .

.

, dragover Template events

$(document).on('dragover', 'td', function(evt) {evt.preventDefault();})

jQuery, domutils.js listeners.js Meteor.

+3
1

@Cuberto , , Meteor Blaze UI ( ).

Blaze jQuery, , , , .

Blaze, :

meteor update --release template-engine-preview-10.1

, Meteor (0.7.0.1), , EDIT , :

$(document).on('dragover', 'td', function(evt) {evt.preventDefault();})
+1

All Articles