Browse Source

* retina

pull/10/head
RubaXa 11 years ago
parent
commit
11cc7d2766
  1. 17
      Sortable.js
  2. 2
      Sortable.min.js
  3. 2
      index.html

17
Sortable.js

@ -220,19 +220,28 @@
activeGroup = this.options.group; activeGroup = this.options.group;
if( isTouch ){ if( isTouch ){
var rect = target.getBoundingClientRect(), css = _css(target); var
rect = target.getBoundingClientRect()
, css = _css(target)
, ghostRect
;
ghostEl = target.cloneNode(true); ghostEl = target.cloneNode(true);
_css(ghostEl, 'top', rect.top - parseInt(css.marginTop, 10)); _css(ghostEl, 'top', rect.top - parseInt(css.marginTop, 10));
_css(ghostEl, 'left', rect.left - parseInt(css.marginLeft, 10)); _css(ghostEl, 'left', rect.left - parseInt(css.marginLeft, 10));
_css(ghostEl, 'width', rect.right - rect.left); _css(ghostEl, 'width', rect.width);
_css(ghostEl, 'height', rect.bottom - rect.top); _css(ghostEl, 'height', rect.height);
_css(ghostEl, 'opacity', '0.8'); _css(ghostEl, 'opacity', '0.8');
_css(ghostEl, 'position', 'fixed'); _css(ghostEl, 'position', 'fixed');
_css(ghostEl, 'zIndex', '100000'); _css(ghostEl, 'zIndex', '100000');
target.parentNode.insertBefore(ghostEl, target); rootEl.appendChild(ghostEl);
// Fixing dimensions.
ghostRect = ghostEl.getBoundingClientRect();
_css(ghostEl, 'width', rect.width*2 - ghostRect.width);
_css(ghostEl, 'height', rect.height*2 - ghostRect.height);
// Bind touch events // Bind touch events
_on(document, 'touchmove', this._onTouchMove); _on(document, 'touchmove', this._onTouchMove);

2
Sortable.min.js vendored

File diff suppressed because one or more lines are too long

2
index.html

@ -275,7 +275,7 @@ var sort = new Sortable(container, {
handle: ".tile__title", // Restricts sort start click/touch to the specified element handle: ".tile__title", // Restricts sort start click/touch to the specified element
dragabble: ".tile", // Specifies which items inside the element should be sortable dragabble: ".tile", // Specifies which items inside the element should be sortable
onUpdate: function (evt/**Event*/){ onUpdate: function (evt/**Event*/){
var item = evt.detail; // the current dragged HTMLElement var item = evt.item; // the current dragged HTMLElement
} }
}); });

Loading…
Cancel
Save