committed by
Julius Härtl
parent
afec4f211c
commit
abc039a634
@@ -1,6 +1,8 @@
|
|||||||
/js/tests/*
|
/js/tests/*
|
||||||
/js/vendor/*
|
/js/vendor/*
|
||||||
/js/node_modules/*
|
/js/node_modules/*
|
||||||
|
/js/public/*
|
||||||
/karma.conf.js
|
/karma.conf.js
|
||||||
/tests/*
|
/tests/*
|
||||||
/l10n/*
|
/l10n/*
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* global module */
|
||||||
|
|
||||||
module.exports = function(grunt) {
|
module.exports = function(grunt) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|||||||
@@ -48,9 +48,9 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
|
|||||||
StackService.clear(); //FIXME: Is this still needed?
|
StackService.clear(); //FIXME: Is this still needed?
|
||||||
|
|
||||||
$scope.$watch(function () {
|
$scope.$watch(function () {
|
||||||
return BoardService.getCurrent().title;
|
return BoardService.getCurrent().title;
|
||||||
}, function() {
|
}, function () {
|
||||||
$scope.setPageTitle();
|
$scope.setPageTitle();
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.setPageTitle = function () {
|
$scope.setPageTitle = function () {
|
||||||
@@ -100,8 +100,9 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
|
|||||||
|
|
||||||
// filter cards here, as ng-sortable will not work nicely with html-inline filters
|
// filter cards here, as ng-sortable will not work nicely with html-inline filters
|
||||||
$scope.filterData = function (order, text) {
|
$scope.filterData = function (order, text) {
|
||||||
if ($scope.stacks === undefined)
|
if ($scope.stacks === undefined) {
|
||||||
{return;}
|
return;
|
||||||
|
}
|
||||||
angular.copy(StackService.getData(), $scope.stacks);
|
angular.copy(StackService.getData(), $scope.stacks);
|
||||||
$scope.stacks = $filter('orderBy')($scope.stacks, 'order');
|
$scope.stacks = $filter('orderBy')($scope.stacks, 'order');
|
||||||
angular.forEach($scope.stacks, function (value, key) {
|
angular.forEach($scope.stacks, function (value, key) {
|
||||||
|
|||||||
@@ -22,10 +22,14 @@
|
|||||||
|
|
||||||
app.filter('orderObjectBy', function(){
|
app.filter('orderObjectBy', function(){
|
||||||
return function(input, attribute) {
|
return function(input, attribute) {
|
||||||
if (!angular.isObject(input)) {return input;}
|
if (!angular.isObject(input)) {
|
||||||
|
return input;
|
||||||
|
}
|
||||||
var array = [];
|
var array = [];
|
||||||
for(var objectKey in input) {
|
for(var objectKey in input) {
|
||||||
array.push(input[objectKey]);
|
if ({}.hasOwnProperty.call(input, objectKey)) {
|
||||||
|
array.push(input[objectKey]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
array.sort(function(a, b){
|
array.sort(function(a, b){
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ app.filter('textColorFilter', function () {
|
|||||||
var max = Math.max(r, g, b), min = Math.min(r, g, b);
|
var max = Math.max(r, g, b), min = Math.min(r, g, b);
|
||||||
var h, s, l = (max + min) / 2;
|
var h, s, l = (max + min) / 2;
|
||||||
|
|
||||||
if (max == min) {
|
if (max === min) {
|
||||||
h = s = 0; // achromatic
|
h = s = 0; // achromatic
|
||||||
} else {
|
} else {
|
||||||
var d = max - min;
|
var d = max - min;
|
||||||
|
|||||||
@@ -132,6 +132,6 @@ app.factory('CardService', function (ApiService, $http, $q) {
|
|||||||
return deferred.promise;
|
return deferred.promise;
|
||||||
};
|
};
|
||||||
|
|
||||||
service = new CardService($http, 'cards', $q);
|
var service = new CardService($http, 'cards', $q);
|
||||||
return service;
|
return service;
|
||||||
});
|
});
|
||||||
@@ -103,7 +103,7 @@ app.factory('StackService', function (ApiService, $http, $q) {
|
|||||||
var self = this;
|
var self = this;
|
||||||
var cards = this.data[entity.stackId].cards;
|
var cards = this.data[entity.stackId].cards;
|
||||||
for (var i = 0; i < cards.length; i++) {
|
for (var i = 0; i < cards.length; i++) {
|
||||||
if (cards[i].id == entity.id) {
|
if (cards[i].id === entity.id) {
|
||||||
cards[i] = entity;
|
cards[i] = entity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,13 +112,13 @@ app.factory('StackService', function (ApiService, $http, $q) {
|
|||||||
var self = this;
|
var self = this;
|
||||||
var cards = this.data[entity.stackId].cards;
|
var cards = this.data[entity.stackId].cards;
|
||||||
for (var i = 0; i < cards.length; i++) {
|
for (var i = 0; i < cards.length; i++) {
|
||||||
if (cards[i].id == entity.id) {
|
if (cards[i].id === entity.id) {
|
||||||
cards.splice(i, 1);
|
cards.splice(i, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
service = new StackService($http, 'stacks', $q);
|
var service = new StackService($http, 'stacks', $q);
|
||||||
return service;
|
return service;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -12,4 +12,5 @@ find -name "*.js" -not -path '*js/node_modules*' \
|
|||||||
-not -path '*l10n/*' \
|
-not -path '*l10n/*' \
|
||||||
-not -path '*js/vendor*' \
|
-not -path '*js/vendor*' \
|
||||||
-not -path '*js/tests*' \
|
-not -path '*js/tests*' \
|
||||||
-print0 | xargs -0 $ESLINT --quiet
|
-not -path '*js/public*' \
|
||||||
|
-print0 | xargs -0 $ESLINT
|
||||||
|
|||||||
Reference in New Issue
Block a user