From b9a292fe0cdab157eaf350939119b15f3ed17380 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Tue, 8 Apr 2014 13:07:38 +0200 Subject: [PATCH] Fix #230 - paste images with new confirm boxes --- app/js/directives.js | 16 +++++++--------- app/partials/confirm_modal.html | 10 ++++++++++ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/app/js/directives.js b/app/js/directives.js index f2a491db..1d71d20f 100644 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -368,7 +368,7 @@ angular.module('myApp.directives', ['myApp.filters']) }) - .directive('mySendForm', function ($timeout, AppConfigManager) { + .directive('mySendForm', function ($timeout, AppConfigManager, ErrorService) { return { link: link, @@ -530,12 +530,10 @@ angular.module('myApp.directives', ['myApp.filters']) var blob = new Blob([array], {type: contentType}); - if (safeConfirm('Are you sure to send file(s) from clipboard?')) { - $scope.$apply(function () { - $scope.draftMessage.files = [blob]; - $scope.draftMessage.isMedia = true; - }); - } + ErrorService.confirm({type: 'FILE_CLIPBOARD_PASTE'}).then(function () { + $scope.draftMessage.files = [blob]; + $scope.draftMessage.isMedia = true; + }); } }; @@ -551,8 +549,8 @@ angular.module('myApp.directives', ['myApp.filters']) } } - if (files.length && safeConfirm('Are you sure to send file(s) from clipboard?')) { - $scope.$apply(function () { + if (files.length > 0) { + ErrorService.confirm({type: 'FILES_CLIPBOARD_PASTE', files: files}).then(function () { $scope.draftMessage.files = files; $scope.draftMessage.isMedia = true; }); diff --git a/app/partials/confirm_modal.html b/app/partials/confirm_modal.html index c9cb1a08..80143612 100644 --- a/app/partials/confirm_modal.html +++ b/app/partials/confirm_modal.html @@ -9,6 +9,14 @@ A new version of Webogram is available. Load it? Are you sure? This can not be undone! Are you sure you want to log out all devices except for the current one? + + + + + + Are you sure to send file(s) from clipboard? + @@ -21,6 +29,8 @@