]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix variable definitions in oc dialogs 4614/head
authorMorris Jobke <hey@morrisjobke.de>
Mon, 1 May 2017 04:09:29 +0000 (01:09 -0300)
committerMorris Jobke <hey@morrisjobke.de>
Mon, 1 May 2017 04:09:29 +0000 (01:09 -0300)
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
core/js/js.js
core/js/oc-dialogs.js
core/js/octemplate.js

index d601f79033ee932f7f762369a1903a1741e18bac..407fbc8cb8ee40dbc309641648cde28f62b21142 100644 (file)
@@ -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]);
index 92f256699af0a21428452c24afbe16017b0e5db2..d37e8501fc80fdd518e5143922635484315b1d0c 100644 (file)
@@ -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,
index b24ad95c2b0027a32628482f2695c76d8e8aa94f..659f795982ac96f692f9475b3d495bb7c8c9fdf1 100644 (file)
@@ -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);