Skip to content

Commit

Permalink
v1.0.1: #231, #210, #207, #205, #151
Browse files Browse the repository at this point in the history
  • Loading branch information
RubaXa committed Jan 26, 2015
2 parents 8f2aa5e + fa2651f commit 0ce769b
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 22 deletions.
Empty file modified Gruntfile.js
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ Sortable.create(list, {
#### `ghostClass` option
Class name for the drop placeholder.

Demo: http://jsbin.com/boqugumiqi/1/edit?css,js,output
Demo: http://jsbin.com/hunifu/1/edit?css,js,output

```css
.ghost {
Expand Down
22 changes: 12 additions & 10 deletions Sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -626,16 +626,18 @@
// Remove event
_dispatchEvent(rootEl, 'remove', dragEl, rootEl, oldIndex, newIndex);
}
else if (dragEl.nextSibling !== nextEl) {
// (1) Remove clone
else {
// Remove clone
cloneEl && cloneEl.parentNode.removeChild(cloneEl);

// (2) Get the index of the dragged element within its parent
newIndex = _index(dragEl);
if (dragEl.nextSibling !== nextEl) {
// Get the index of the dragged element within its parent
newIndex = _index(dragEl);

// drag & drop within the same list
_dispatchEvent(rootEl, 'update', dragEl, rootEl, oldIndex, newIndex);
_dispatchEvent(rootEl, 'sort', dragEl, rootEl, oldIndex, newIndex);
// drag & drop within the same list
_dispatchEvent(rootEl, 'update', dragEl, rootEl, oldIndex, newIndex);
_dispatchEvent(rootEl, 'sort', dragEl, rootEl, oldIndex, newIndex);
}
}

// Drag end event
Expand Down Expand Up @@ -819,7 +821,7 @@
do {
if (
(tag === '>*' && el.parentNode === ctx) || (
(tag === '' || el.nodeName == tag) &&
(tag === '' || el.nodeName.toUpperCase() == tag) &&
(!selector.length || ((' ' + el.className + ' ').match(re) || []).length == selector.length)
)
) {
Expand Down Expand Up @@ -947,7 +949,7 @@
*/
function _index(/**HTMLElement*/el) {
var index = 0;
while (el && (el = el.previousElementSibling) && (el.nodeName !== 'TEMPLATE')) {
while (el && (el = el.previousElementSibling) && (el.nodeName.toUpperCase() !== 'TEMPLATE')) {
index++;
}
return index;
Expand Down Expand Up @@ -993,7 +995,7 @@
};


Sortable.version = '1.0.0';
Sortable.version = '1.0.1';


/**
Expand Down
4 changes: 2 additions & 2 deletions Sortable.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Sortable",
"main": "Sortable.js",
"version": "1.0.0",
"version": "1.0.1",
"homepage": "http://rubaxa.github.io/Sortable/",
"authors": [
"RubaXa <[email protected]>"
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Sortable",
"main": "Sortable.js",
"version": "1.0.0",
"version": "1.0.1",
"homepage": "http://rubaxa.github.io/Sortable/",
"repo": "RubaXa/Sortable",
"authors": [
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ <h1 data-force="40" data-force-y="2.5">The JavaScript library for modern browser
</div>

<div style="width: 25%; float: left; margin-top: 15px; margin-left: 10px" class="block__list block__list_words">
<div class="block__list-title">only pull (clone), no reordering</div>
<div class="block__list-title">only pull (clone) no&nbsp;reordering</div>
<ul id="advanced-2">
<li>Sex</li>
<li>Drugs</li>
Expand Down
2 changes: 1 addition & 1 deletion meteor/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Package.describe({
Package.onUse(function (api) {
api.versionsFrom(['[email protected]', '[email protected]']);
api.use('templating', 'client');
api.use('dburles:[email protected].5'); // to watch collections getting created
api.use('dburles:[email protected].6'); // to watch collections getting created
api.export('Sortable');
api.addFiles([
'Sortable.js',
Expand Down
6 changes: 4 additions & 2 deletions ng-sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'use strict';

angular.module('ng-sortable', [])
.constant('$version', '0.3.3')
.constant('$version', '0.3.4')
.directive('ngSortable', ['$parse', function ($parse) {
var removed,
nextSibling;
Expand All @@ -28,7 +28,9 @@
(node.nodeValue.indexOf('ngRepeat:') !== -1)
);
})[0];
ngRepeat = ngRepeat.nodeValue.match(/ngRepeat:\s*([^\s]+)\s+in\s+([^\s|]+)/);

// tests: http://jsbin.com/kosubutilo/1/edit?js,output
ngRepeat = ngRepeat.nodeValue.match(/ngRepeat:\s*(?:\(.*?,\s*)?([^\s)]+)[\s)]+in\s+([^\s|]+)/);

var itemExpr = $parse(ngRepeat[1]);
var itemsExpr = $parse(ngRepeat[2]);
Expand Down
15 changes: 12 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sortablejs",
"exportName": "Sortable",
"version": "1.0.0",
"version": "1.0.1",
"devDependencies": {
"grunt": "*",
"grunt-version": "*",
Expand All @@ -22,8 +22,17 @@
"keywords": [
"sortable",
"reorder",
"drag"
"drag",
"ng-srotable",
"angular"
],
"author": "Konstantin Lebedev <[email protected]>",
"license": "MIT"
"license": "MIT",
"spm": {
"main": "Sortable.js",
"ignore": [
"meteor",
"st"
]
}
}
1 change: 1 addition & 0 deletions st/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ img {
margin-right: 10px;
font: bold 20px Sans-Serif;
color: #5F9EDF;
display: inline-block;
cursor: move;
cursor: -webkit-grabbing; /* overrides 'move' */
}
Expand Down

0 comments on commit 0ce769b

Please sign in to comment.