Skip to content

Commit ddc518a

Browse files
committed
v0.0.13
1 parent f1c97bd commit ddc518a

File tree

6 files changed

+51
-21
lines changed

6 files changed

+51
-21
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Version 0.0.13 - 2015/01/13
2+
================
3+
4+
* bug fixes
5+
16
Version 0.0.12 - 2014/12/09
27
================
38

Gruntfile.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ module.exports = function(grunt){
99
files: {
1010
'src/angular-sortable-view.min.js': ['src/angular-sortable-view.js']
1111
}
12+
},
13+
options: {
14+
banner: '/*\n\tCopyright Kamil Pękala http://github.com/kamilkp\n' +
15+
'\tangular-sortable-view v0.0.13 2015/01/13\n*/\n'
1216
}
1317
},
1418
jshint: {

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
angular-sortable-view v0.0.12 [![Bower version](https://badge.fury.io/bo/angular-sortable-view.svg)](http://badge.fury.io/bo/angular-sortable-view)
1+
angular-sortable-view v0.0.13 [![Bower version](https://badge.fury.io/bo/angular-sortable-view.svg)](http://badge.fury.io/bo/angular-sortable-view)
22
=================
33

44
Fully declarative (multi)sortable for AngularJS
@@ -49,7 +49,7 @@ The API is declarative. There are four directives (hooked on attributes) that ne
4949
* `sv-element` - this attribute should be placed on the same element as `ng-repeat` attribute. Its (optional) value should be an expression that evaluates to the options object.
5050
* `sv-handle` - this attribute is optional. If needed it can be placed on an element within the sortable element. This element will be the handle for sorting operations.
5151
* `sv-helper` - the element with this attribute will serve as a custom helper for sorting operations
52-
* `sv-placeholder` - the element with this attribute will serve as a custom placeholder for sorting operations
52+
* `sv-placeholder` - the element with this attribute will serve as a custom placeholder for sorting operations
5353

5454
###Example of single sortable list
5555

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-sortable-view",
3-
"version": "0.0.12",
3+
"version": "0.0.13",
44
"description": "Fully declarative (multi)sortable for AngularJS",
55
"homepage": "http://kamilkp.github.io/angular-sortable-view",
66
"author": {

src/angular-sortable-view.js

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
//
22
// Copyright Kamil Pękala http://github.com/kamilkp
3-
// angular-sortable-view v0.0.11 2014/11/28
3+
// angular-sortable-view v0.0.13 2015/01/13
44
//
55

66
;(function(window, angular){
77
'use strict';
88
/* jshint eqnull:true */
99
/* jshint -W041 */
10+
/* jshint -W030 */
1011

1112
var module = angular.module('angular-sortable-view', []);
1213
module.directive('svRoot', [function(){
@@ -30,26 +31,26 @@
3031
var mapKey = $interpolate($attrs.svRoot)($scope) || $scope.$id;
3132
if(!ROOTS_MAP[mapKey]) ROOTS_MAP[mapKey] = [];
3233

33-
var that = this;
34-
var candidates; // set of possible destinations
35-
var $placeholder; // placeholder element
36-
var options; // sortable options
37-
var $helper; // helper element - the one thats being dragged around with the mouse pointer
38-
var $original; // original element
39-
var $target; // last best candidate
40-
var isGrid = false;
41-
var onSort = $parse($attrs.svOnSort);
34+
var that = this;
35+
var candidates; // set of possible destinations
36+
var $placeholder;// placeholder element
37+
var options; // sortable options
38+
var $helper; // helper element - the one thats being dragged around with the mouse pointer
39+
var $original; // original element
40+
var $target; // last best candidate
41+
var isGrid = false;
42+
var onSort = $parse($attrs.svOnSort);
4243

4344
// ----- hack due to https://github.com/angular/angular.js/issues/8044
4445
$attrs.svOnStart = $attrs.$$element[0].attributes['sv-on-start'];
45-
$attrs.svOnStart = $attrs.svOnStart && $attrs.svOnStart.value;
46+
$attrs.svOnStart = $attrs.svOnStart && $attrs.svOnStart.value;
4647

4748
$attrs.svOnStop = $attrs.$$element[0].attributes['sv-on-stop'];
48-
$attrs.svOnStop = $attrs.svOnStop && $attrs.svOnStop.value;
49+
$attrs.svOnStop = $attrs.svOnStop && $attrs.svOnStop.value;
4950
// -------------------------------------------------------------------
5051

5152
var onStart = $parse($attrs.svOnStart);
52-
var onStop = $parse($attrs.svOnStop);
53+
var onStop = $parse($attrs.svOnStop);
5354

5455
this.sortingInProgress = function(){
5556
return sortingInProgress;
@@ -246,7 +247,7 @@
246247
options = void 0;
247248
$helper = void 0;
248249
$original = void 0;
249-
250+
250251
// sv-on-stop callback
251252
onStop($scope, {
252253
$part: originatingPart.model(originatingPart.scope),
@@ -277,8 +278,7 @@
277278
}
278279
$target = void 0;
279280

280-
if($scope.$root)
281-
$scope.$root.$$phase || $scope.$apply();
281+
$scope.$root && $scope.$root.$$phase || $scope.$apply();
282282
}
283283
};
284284

@@ -384,7 +384,7 @@
384384

385385
var body = angular.element(document.body);
386386
var html = angular.element(document.documentElement);
387-
387+
388388
var moveExecuted;
389389

390390
function onMousedown(e){
@@ -605,4 +605,21 @@
605605
return angular.element();
606606
};
607607

608+
/*
609+
Simple implementation of jQuery's .add method
610+
*/
611+
if(typeof angular.element.prototype.add !== 'function'){
612+
angular.element.prototype.add = function(elem){
613+
var i, res = angular.element();
614+
elem = angular.element(elem);
615+
for(i=0;i<this.length;i++){
616+
res.push(this[i]);
617+
}
618+
for(i=0;i<elem.length;i++){
619+
res.push(elem[i]);
620+
}
621+
return res;
622+
};
623+
}
624+
608625
})(window, window.angular);

0 commit comments

Comments
 (0)