Fix variable definitions in oc dialogs
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
parent
4518f6dc64
commit
d222351c87
|
@ -150,7 +150,7 @@ var OCP = {},
|
||||||
_.defaults(allOptions, defaultOptions);
|
_.defaults(allOptions, defaultOptions);
|
||||||
|
|
||||||
var _build = function (text, vars) {
|
var _build = function (text, vars) {
|
||||||
var vars = vars || [];
|
vars = vars || [];
|
||||||
return text.replace(/{([^{}]*)}/g,
|
return text.replace(/{([^{}]*)}/g,
|
||||||
function (a, b) {
|
function (a, b) {
|
||||||
var r = (vars[b]);
|
var r = (vars[b]);
|
||||||
|
|
|
@ -813,11 +813,13 @@ var OCdialogs = {
|
||||||
|
|
||||||
$.each(files, function(idx, entry) {
|
$.each(files, function(idx, entry) {
|
||||||
entry.icon = OC.MimeType.getIconUrl(entry.mimetype);
|
entry.icon = OC.MimeType.getIconUrl(entry.mimetype);
|
||||||
|
var simpleSize, sizeColor;
|
||||||
if (typeof(entry.size) !== 'undefined' && entry.size >= 0) {
|
if (typeof(entry.size) !== 'undefined' && entry.size >= 0) {
|
||||||
var simpleSize = humanFileSize(parseInt(entry.size, 10), true);
|
simpleSize = humanFileSize(parseInt(entry.size, 10), true);
|
||||||
var sizeColor = Math.round(160 - Math.pow((entry.size / (1024 * 1024)), 2));
|
sizeColor = Math.round(160 - Math.pow((entry.size / (1024 * 1024)), 2));
|
||||||
} else {
|
} else {
|
||||||
simpleSize = t('files', 'Pending');
|
simpleSize = t('files', 'Pending');
|
||||||
|
sizeColor = 80;
|
||||||
}
|
}
|
||||||
var $row = self.$listTmpl.octemplate({
|
var $row = self.$listTmpl.octemplate({
|
||||||
type: entry.type,
|
type: entry.type,
|
||||||
|
|
|
@ -94,7 +94,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
$.fn.octemplate = function(vars, options) {
|
$.fn.octemplate = function(vars, options) {
|
||||||
var vars = vars ? vars : {};
|
vars = vars || {};
|
||||||
if(this.length) {
|
if(this.length) {
|
||||||
var _template = Object.create(Template);
|
var _template = Object.create(Template);
|
||||||
return _template.init(vars, options, this);
|
return _template.init(vars, options, this);
|
||||||
|
|
Loading…
Reference in New Issue