From 7bafa54ae168a25b47d579fdca4cec19f2e1534f Mon Sep 17 00:00:00 2001 From: Tomasz Grobelny Date: Tue, 13 Nov 2018 23:19:08 +0100 Subject: [PATCH] Fix progress bar label Signed-off-by: Tomasz Grobelny --- apps/files/js/operationprogressbar.js | 14 ++++++-------- apps/files/js/templates.js | 15 ++++++++++----- .../js/templates/operationprogressbar.handlebars | 2 +- .../operationprogressbarlabel.handlebars | 4 ++++ 4 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 apps/files/js/templates/operationprogressbarlabel.handlebars diff --git a/apps/files/js/operationprogressbar.js b/apps/files/js/operationprogressbar.js index 1d96c2374d4..0ce532af494 100644 --- a/apps/files/js/operationprogressbar.js +++ b/apps/files/js/operationprogressbar.js @@ -18,10 +18,9 @@ render: function() { this.$el.html(OCA.Files.Templates['operationprogressbar']({ - textDesktop: t('Uploading …'), - textMobile: t('…'), textCancelButton: t('Cancel operation') })); + this.setProgressBarText(t('Uploading …'), t('…')); }, hideProgressBar: function() { @@ -50,12 +49,11 @@ }, setProgressBarText: function(textDesktop, textMobile, title) { - $('#uploadprogressbar .ui-progressbar-value'). - html('' - + textDesktop - + '' - + textMobile - + ''); + var labelHtml = OCA.Files.Templates['operationprogressbarlabel']({textDesktop: textDesktop, textMobile: textMobile}); + $('#uploadprogressbar .ui-progressbar-value').html(labelHtml); + $('#uploadprogressbar .ui-progressbar-value>em').addClass('inner'); + $('#uploadprogressbar>em').replaceWith(labelHtml); + $('#uploadprogressbar>em').addClass('outer'); $('#uploadprogressbar').tooltip({placement: 'bottom'}); if(title) { $('#uploadprogressbar').attr('original-title', title); diff --git a/apps/files/js/templates.js b/apps/files/js/templates.js index 0d41c52797f..be6b255d594 100644 --- a/apps/files/js/templates.js +++ b/apps/files/js/templates.js @@ -246,15 +246,20 @@ templates['newfilemenu_filename_form'] = template({"compiler":[7,">= 4.0.0"],"ma + "\" autocomplete=\"off\" autocapitalize=\"off\">\n \n\n"; },"useData":true}); templates['operationprogressbar'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + var helper; + + return "
\n \n
\n\n"; +},"useData":true}); +templates['operationprogressbarlabel'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; - return "
\n " + return "\n " + alias4(((helper = (helper = helpers.textDesktop || (depth0 != null ? depth0.textDesktop : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"textDesktop","hash":{},"data":data}) : helper))) - + "" + + "\n " + alias4(((helper = (helper = helpers.textMobile || (depth0 != null ? depth0.textMobile : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"textMobile","hash":{},"data":data}) : helper))) - + "\n
\n\n"; + + "\n\n"; },"useData":true}); templates['template_addbutton'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; diff --git a/apps/files/js/templates/operationprogressbar.handlebars b/apps/files/js/templates/operationprogressbar.handlebars index 5d6a7e860f0..c02ac623fab 100644 --- a/apps/files/js/templates/operationprogressbar.handlebars +++ b/apps/files/js/templates/operationprogressbar.handlebars @@ -1,5 +1,5 @@
- +