diff --git a/modules/core/client/directives/mt-images-uploader.client.directive.js b/modules/core/client/directives/mt-images-uploader.client.directive.js index 07cc07b6..966b9f49 100644 --- a/modules/core/client/directives/mt-images-uploader.client.directive.js +++ b/modules/core/client/directives/mt-images-uploader.client.directive.js @@ -4,9 +4,9 @@ angular.module('core') .directive('mtImagesUploader', mtImagesUploader); - mtImagesUploader.$inject = ['localStorageService', '$compile', 'NotifycationService', '$translate', 'DebugConsoleService', '$timeout']; + mtImagesUploader.$inject = ['$rootScope', 'localStorageService', '$compile', 'NotifycationService', '$translate', 'DebugConsoleService', '$timeout']; - function mtImagesUploader(localStorageService, $compile, NotifycationService, $translate, mtDebug, $timeout) { + function mtImagesUploader($rootScope, localStorageService, $compile, NotifycationService, $translate, mtDebug, $timeout) { var directive = { restrict: 'A', require: 'ngModel', @@ -21,7 +21,7 @@ if (attrs.uploadMethod) { initVariable(); - var eleUploadList = angular.element('
'); + var eleUploadList = angular.element('
'); var eleUploadTip = angular.element('
{{\'IMAGES_UPLOAD_TOOLTIP1\' | translate}}{{\'IMAGES_UPLOAD_TOOLTIP2\' | translate}}
'); var eleUploadBegin = angular.element('
{{\'IMAGES_UPLOADING\' | translate}}: {{uFile.name}}
'); @@ -38,6 +38,10 @@ doUpload(scope.selectedFile); }; + scope.showFaTimes = function (idx) { + $('.image-item').find('#fa-' + idx).css('display', 'block'); + }; + element.bind('dragenter', function (evt) { evt.stopPropagation(); evt.preventDefault(); @@ -57,12 +61,10 @@ //define method called from parent scope //init all variable - scope.$parent.clearResourceImages = function () { + $rootScope.clearResourceImages = function () { scope.ngModel = []; initVariable(); }; - scope.$parent.$parent.clearResourceImages = scope.$parent.clearResourceImages; - $compile(element.contents())(scope); } diff --git a/modules/torrents/client/controllers/uploads.client.controller.js b/modules/torrents/client/controllers/uploads.client.controller.js index 7ce4e4e6..b632d0a8 100644 --- a/modules/torrents/client/controllers/uploads.client.controller.js +++ b/modules/torrents/client/controllers/uploads.client.controller.js @@ -365,6 +365,8 @@ vm.showVideoNfo = false; vm.showAgreeAndSubmit = false; + + $rootScope.clearResourceImages(); }; /**