Skip to content
Permalink
Browse files

fix(accounts): issue not showing upload dialog

  • Loading branch information...
polonel committed Apr 13, 2019
1 parent 746d5c0 commit 38a4c85378b8e2b58118a17aad5a9894c7627c96
Showing with 17 additions and 2 deletions.
  1. +0 −1 src/controllers/accounts.js
  2. +17 −1 src/public/js/angularjs/controllers/accounts.js
@@ -472,7 +472,6 @@ accountsController.uploadImage = function (req, res) {
})

busboy.on('file', function (fieldname, file, filename, encoding, mimetype) {
console.log(file)
if (mimetype.indexOf('image/') === -1) {
error = {
status: 400,
@@ -13,7 +13,7 @@
*/

define(['angular', 'underscore', 'jquery'], function (angular, _, $) {
return angular.module('trudesk.controllers.accounts', []).controller('accountsCtrl', function ($scope) {
return angular.module('trudesk.controllers.accounts', []).controller('accountsCtrl', function ($scope, $timeout) {
$scope.selectAccountsImport = function (event, type) {
if ($(event.currentTarget).hasClass('card-disabled')) {
return false
@@ -46,5 +46,21 @@ define(['angular', 'underscore', 'jquery'], function (angular, _, $) {
$('#json-import-selector').removeClass('card-disabled')
$('#ldap-import-selector').removeClass('card-disabled')
}

$scope.accountEditPic = function () {
throttledAccountPicClick()
}

function throttledAccountPicClick () {
$timeout(function () {
var $profileImageInput = $('#profileImageInput')
$profileImageInput.on('click', function (event) {
// This function is a firefox hack to stop it from spawning 100000 file dialogs
event.stopPropagation()
})

$profileImageInput.trigger('click')
}, 0)
}
})
})

0 comments on commit 38a4c85

Please sign in to comment.
You can’t perform that action at this time.