Browse Source

Merge branch 'master' into gh-pages

gh-pages
RubaXa 10 years ago
parent
commit
ff260458fb
  1. 4
      README.md
  2. 7
      Sortable.js
  3. 4
      Sortable.min.js
  4. 2
      bower.json
  5. 2
      component.json
  6. 7
      ng-sortable.js
  7. 10
      react-sortable-mixin.js
  8. 3
      st/app.js

4
README.md

@ -583,11 +583,11 @@ Link to the active instance.
```html ```html
<!-- CDNJS :: Sortable (https://cdnjs.com/) --> <!-- CDNJS :: Sortable (https://cdnjs.com/) -->
<script src="//cdnjs.cloudflare.com/ajax/libs/Sortable/1.2.0/Sortable.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/Sortable/1.2.1/Sortable.min.js"></script>
<!-- jsDelivr :: Sortable (http://www.jsdelivr.com/) --> <!-- jsDelivr :: Sortable (http://www.jsdelivr.com/) -->
<script src="//cdn.jsdelivr.net/sortable/1.2.0/Sortable.min.js"></script> <script src="//cdn.jsdelivr.net/sortable/1.2.1/Sortable.min.js"></script>
<!-- jsDelivr :: Sortable :: Latest (http://www.jsdelivr.com/) --> <!-- jsDelivr :: Sortable :: Latest (http://www.jsdelivr.com/) -->

7
Sortable.js

@ -655,8 +655,7 @@
clearInterval(this._loopId); clearInterval(this._loopId);
clearInterval(autoScroll.pid); clearInterval(autoScroll.pid);
clearTimeout(this._dragStartTimer);
clearTimeout(this.dragStartTimer);
// Unbind events // Unbind events
_off(document, 'drop', this); _off(document, 'drop', this);
@ -885,7 +884,7 @@
selector = selector.split('.'); selector = selector.split('.');
var tag = selector.shift().toUpperCase(), var tag = selector.shift().toUpperCase(),
re = new RegExp('\\s(' + selector.join('|') + ')\\s', 'g'); re = new RegExp('\\s(' + selector.join('|') + ')(?=\\s)', 'g');
do { do {
if ( if (
@ -1128,7 +1127,7 @@
}; };
Sortable.version = '1.2.0'; Sortable.version = '1.2.1';
/** /**

4
Sortable.min.js vendored

File diff suppressed because one or more lines are too long

2
bower.json

@ -6,7 +6,7 @@
"knockout-sortable.js", "knockout-sortable.js",
"react-sortable-mixin.js" "react-sortable-mixin.js"
], ],
"version": "1.2.0", "version": "1.2.1",
"homepage": "http://rubaxa.github.io/Sortable/", "homepage": "http://rubaxa.github.io/Sortable/",
"authors": [ "authors": [
"RubaXa <ibnRubaXa@gmail.com>" "RubaXa <ibnRubaXa@gmail.com>"

2
component.json

@ -1,7 +1,7 @@
{ {
"name": "Sortable", "name": "Sortable",
"main": "Sortable.js", "main": "Sortable.js",
"version": "1.2.0", "version": "1.2.1",
"homepage": "http://rubaxa.github.io/Sortable/", "homepage": "http://rubaxa.github.io/Sortable/",
"repo": "RubaXa/Sortable", "repo": "RubaXa/Sortable",
"authors": [ "authors": [

7
ng-sortable.js

@ -25,8 +25,9 @@
angular.module('ng-sortable', []) angular.module('ng-sortable', [])
.constant('version', '0.3.7') .constant('ngSortableVersion', '0.3.7')
.directive('ngSortable', ['$parse', function ($parse) { .constant('ngSortableConfig', {})
.directive('ngSortable', ['$parse', 'ngSortableConfig', function ($parse, ngSortableConfig) {
var removed, var removed,
nextSibling; nextSibling;
@ -67,7 +68,7 @@
scope: { ngSortable: "=?" }, scope: { ngSortable: "=?" },
link: function (scope, $el, attrs) { link: function (scope, $el, attrs) {
var el = $el[0], var el = $el[0],
options = scope.ngSortable || {}, options = angular.extend(scope.ngSortable || {}, ngSortableConfig),
source = getSource(el), source = getSource(el),
watchers = [], watchers = [],
sortable sortable

10
react-sortable-mixin.js vendored

@ -134,6 +134,16 @@
this._sortableInstance = Sortable.create((this.refs[options.ref] || this).getDOMNode(), copyOptions); this._sortableInstance = Sortable.create((this.refs[options.ref] || this).getDOMNode(), copyOptions);
}, },
componentWillReceiveProps: function (nextProps) {
var newState = {},
modelName = _getModelName(this),
items = nextProps[modelName];
if (items) {
newState[modelName] = items;
this.setState(newState);
}
},
componentWillUnmount: function () { componentWillUnmount: function () {
this._sortableInstance.destroy(); this._sortableInstance.destroy();

3
st/app.js

@ -148,6 +148,9 @@
// Angular example // Angular example
angular.module('todoApp', ['ng-sortable']) angular.module('todoApp', ['ng-sortable'])
.constant('ngSortableConfig', {onEnd: function() {
console.log('default onEnd()');
}})
.controller('TodoController', ['$scope', function ($scope) { .controller('TodoController', ['$scope', function ($scope) {
$scope.todos = [ $scope.todos = [
{text: 'learn angular', done: true}, {text: 'learn angular', done: true},

Loading…
Cancel
Save