aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-05-01 16:54:53 +0200
committerGitHub <noreply@github.com>2017-05-01 16:54:53 +0200
commit99f98ca34337eb4e9908d569d6009f7d24e289e1 (patch)
tree4be133f1d3eb91c481459625674cfa611c9ff595 /core
parent1e35c9d8b66902d3a73c11cbeee7f4e6cb5f0afc (diff)
parentd222351c873f03764d934f9ba8d55099c16c6be7 (diff)
downloadnextcloud-server-99f98ca34337eb4e9908d569d6009f7d24e289e1.tar.gz
nextcloud-server-99f98ca34337eb4e9908d569d6009f7d24e289e1.zip
Merge pull request #4614 from nextcloud/js-fix-dialogs-and-octemplate
Fix variable definitions in oc dialogs
Diffstat (limited to 'core')
-rw-r--r--core/js/js.js2
-rw-r--r--core/js/oc-dialogs.js6
-rw-r--r--core/js/octemplate.js2
3 files changed, 6 insertions, 4 deletions
diff --git a/core/js/js.js b/core/js/js.js
index d601f79033e..407fbc8cb8e 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -150,7 +150,7 @@ var OCP = {},
_.defaults(allOptions, defaultOptions);
var _build = function (text, vars) {
- var vars = vars || [];
+ vars = vars || [];
return text.replace(/{([^{}]*)}/g,
function (a, b) {
var r = (vars[b]);
diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js
index 92f256699af..d37e8501fc8 100644
--- a/core/js/oc-dialogs.js
+++ b/core/js/oc-dialogs.js
@@ -813,11 +813,13 @@ var OCdialogs = {
$.each(files, function(idx, entry) {
entry.icon = OC.MimeType.getIconUrl(entry.mimetype);
+ var simpleSize, sizeColor;
if (typeof(entry.size) !== 'undefined' && entry.size >= 0) {
- var simpleSize = humanFileSize(parseInt(entry.size, 10), true);
- var sizeColor = Math.round(160 - Math.pow((entry.size / (1024 * 1024)), 2));
+ simpleSize = humanFileSize(parseInt(entry.size, 10), true);
+ sizeColor = Math.round(160 - Math.pow((entry.size / (1024 * 1024)), 2));
} else {
simpleSize = t('files', 'Pending');
+ sizeColor = 80;
}
var $row = self.$listTmpl.octemplate({
type: entry.type,
diff --git a/core/js/octemplate.js b/core/js/octemplate.js
index b24ad95c2b0..659f795982a 100644
--- a/core/js/octemplate.js
+++ b/core/js/octemplate.js
@@ -94,7 +94,7 @@
};
$.fn.octemplate = function(vars, options) {
- var vars = vars ? vars : {};
+ vars = vars || {};
if(this.length) {
var _template = Object.create(Template);
return _template.init(vars, options, this);