diff --git a/js/controller/CardController.js b/js/controller/CardController.js index afc15bffa..f7002b8b4 100644 --- a/js/controller/CardController.js +++ b/js/controller/CardController.js @@ -20,7 +20,7 @@ * */ -/* global app moment */ +/* global app moment angular OC */ import app from '../app/App.js'; app.controller('CardController', function ($scope, $rootScope, $sce, $location, $stateParams, $state, $interval, $timeout, $filter, BoardService, CardService, StackService, StatusService, markdownItConverter, FileService) { diff --git a/js/filters/bytesFilter.js b/js/filters/bytesFilter.js index ee81e16f7..67d2ce6ab 100644 --- a/js/filters/bytesFilter.js +++ b/js/filters/bytesFilter.js @@ -27,7 +27,7 @@ app.filter('bytes', function () { if (isNaN(parseFloat(bytes, 10)) || !isFinite(bytes)) { return '-'; } - if (precision === undefined) { + if (typeof precision === 'undefined') { precision = 2; } var units = ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB'], diff --git a/js/service/ApiService.js b/js/service/ApiService.js index 9251ee902..051479417 100644 --- a/js/service/ApiService.js +++ b/js/service/ApiService.js @@ -125,7 +125,7 @@ app.factory('ApiService', function ($http, $q) { this.data[entity.id] = entity; } else { Object.keys(entity).forEach(function (key) { - if (entity[key] !== null) { + if (entity[key] !== null && element[key] !== entity[key]) { element[key] = entity[key]; } }); diff --git a/js/service/FileService.js b/js/service/FileService.js index 7d61b29f0..89a219ea9 100644 --- a/js/service/FileService.js +++ b/js/service/FileService.js @@ -22,6 +22,7 @@ import app from '../app/App.js'; +/* global OC oc_requesttoken */ export default class FileService { constructor ($http, FileUploader, CardService) { @@ -51,7 +52,7 @@ export default class FileService { }; this.uploader.uploadItem(fileItem); - }; + } onAfterAddingFile (fileItem) { // Fetch card details before trying to upload so we can detect filename collisions properly @@ -87,11 +88,11 @@ export default class FileService { }); - }; + } onSuccessItem(item, response) { let attachments = this.cardservice.get(item.cardId).attachments; - let index = attachments.indexOf(attachments.find(attachment => attachment.id === response.id)); + let index = attachments.indexOf(attachments.find((attachment) => attachment.id === response.id)); if (~index) { attachments = attachments.splice(index, 1); } diff --git a/js/service/StackService.js b/js/service/StackService.js index 3c98c585b..a4671a331 100644 --- a/js/service/StackService.js +++ b/js/service/StackService.js @@ -21,6 +21,7 @@ */ import app from '../app/App.js'; +/* global app angular */ app.factory('StackService', function (ApiService, CardService, $http, $q) { var StackService = function ($http, ep, $q) { ApiService.call(this, $http, ep, $q);