Browse Source

Update sorter move and add 'component:dragging' event

pull/79/merge
Artur Arseniev 10 years ago
parent
commit
abd19253eb
  1. 1
      index.html
  2. 11
      src/utils/Sorter.js

1
index.html

@ -14,7 +14,6 @@
<div id="gjs" style="height:0px; overflow:hidden">
<header class="header-banner">
<div style="color:red; width: 300px;">TEST</div>
<div class="container-width">
<!--
<table>

11
src/utils/Sorter.js

@ -613,11 +613,20 @@ define(function(require) {
* @param {Object} pos Object with position coordinates
* */
move: function(dst, src, pos) {
if (this.em) this.em.trigger('component:dragging', [dst, src, pos]);
var index = pos.index;
var model = $(src).data('model');
var $dst = $(dst);
var targetModel;
while ($dst.length && !targetModel) {
targetModel = $dst.data('model');
if (!targetModel)
$dst = $dst.parent();
}
var targetCollection = $dst.data('collection');
var targetModel = $dst.data('model');
// Check if the elemenet is DRAGGABLE to the target
var drag = model && model.get('draggable');

Loading…
Cancel
Save