Skip to content

Commit

Permalink
fix(edit): fix saving issue in edit mode
Browse files Browse the repository at this point in the history
Fix usage of $document

closes #286
  • Loading branch information
mpfeil committed Nov 26, 2018
1 parent b56092b commit f81a9d8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
6 changes: 3 additions & 3 deletions app/scripts/controllers/account.box.edit.general.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
.module('openSenseMapApp')
.controller('EditBoxGeneralController', EditBoxGeneralController);

EditBoxGeneralController.$inject = ['$state', '$document', 'notifications', 'boxData', 'AccountService'];
EditBoxGeneralController.$inject = ['$document', 'notifications', 'boxData', 'AccountService'];

function EditBoxGeneralController ($state, $document, notifications, boxData, AccountService) {
function EditBoxGeneralController ($document, notifications, boxData, AccountService) {
var vm = this;
vm.editingMarker = {};
vm.password = '';
Expand All @@ -25,7 +25,7 @@
}

function save () {
var imgsrc = angular.element($document.getElementById('flowUploadImage')).attr('src');
var imgsrc = angular.element($document[0].getElementById('flowUploadImage')).attr('src');
var data = {
name: vm.editingMarker.name,
description: vm.editingMarker.description,
Expand Down
4 changes: 2 additions & 2 deletions app/scripts/controllers/signup.login.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
.module('openSenseMapApp')
.controller('SignupLoginController', SignupLoginController);

SignupLoginController.$inject = ['$rootScope', '$scope', '$state', '$window', '$document', '$q', 'AccountService'];
SignupLoginController.$inject = ['$rootScope', '$scope', '$state', '$q', 'AccountService'];

function SignupLoginController ($rootScope, $scope, $state, $window, $document, $q, AccountService) {
function SignupLoginController ($rootScope, $scope, $state, $q, AccountService) {
var vm = this;

vm.signup = {
Expand Down
13 changes: 8 additions & 5 deletions app/scripts/services/boxesService.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,27 @@
return getBoxesWithProgress({ minimal: true, classify: true })
.then(function (response) {
boxes = response;

return boxes;
});
} else {
return Promise.resolve(boxes);
}

return Promise.resolve(boxes);
}

function getBoxesFullMetadata() {
function getBoxesFullMetadata () {
if (!fullMetadataLoaded) {
return getBoxesWithProgress({ minimal: false, classify: true })
.then(function (response) {
fullMetadataLoaded = true;
boxes = response;

return boxes;
});
} else {
return Promise.resolve(boxes);
}

return Promise.resolve(boxes);

}

function getBoxesWithProgress (params) {
Expand Down

0 comments on commit f81a9d8

Please sign in to comment.