refactor drive to use dialog.selectable()

fix class on alertify-like boxes
This commit is contained in:
ansuz
2017-09-08 12:24:20 +02:00
parent fe2454ba31
commit bbf7ed3827
2 changed files with 44 additions and 24 deletions

View File

@@ -2339,9 +2339,9 @@ define([
$('<br>').appendTo($d);
if (!ro) {
$('<label>', {'for': 'propLink'}).text(Messages.editShare).appendTo($d);
$('<input>', {'id': 'propLink', 'readonly': 'readonly', 'value': base + data.href})
.click(function () { $(this).select(); })
.appendTo($d);
$d.append(Cryptpad.dialog.selectable(base + data.href, {
id: 'propLink',
}));
}
var parsed = Cryptpad.parsePadUrl(data.href);
@@ -2349,9 +2349,9 @@ define([
var roLink = ro ? base + data.href : getReadOnlyUrl(el);
if (roLink) {
$('<label>', {'for': 'propROLink'}).text(Messages.viewShare).appendTo($d);
$('<input>', {'id': 'propROLink', 'readonly': 'readonly', 'value': roLink})
.click(function () { $(this).select(); })
.appendTo($d);
$d.append(Cryptpad.dialog.selectable(roLink, {
id: 'propROLink',
}));
}
}
@@ -2369,20 +2369,17 @@ define([
return void cb(void 0, $d);
}
var KB = Cryptpad.bytesToKilobytes(bytes);
var formatted = Messages._getKey('formattedKB', [KB]);
$('<br>').appendTo($d);
$('<label>', {
'for': 'size'
}).text(Messages.fc_sizeInKilobytes).appendTo($d);
$('<input>', {
$d.append(Cryptpad.dialog.selectable(formatted, {
id: 'size',
readonly: 'readonly',
value: KB + 'KB',
})
.click(function () { $(this).select(); })
.appendTo($d);
}));
cb(void 0, $d);
});
} else {
@@ -2438,8 +2435,7 @@ define([
var el = filesOp.find(paths[0].path);
getProperties(el, function (e, $prop) {
if (e) { return void logError(e); }
Cryptpad.alert('', undefined, true);
$('.alertify .msg').html("").append($prop);
Cryptpad.alert($prop[0], undefined, true);
});
}
module.hideMenu();
@@ -2490,8 +2486,7 @@ define([
var el = filesOp.find(paths[0].path);
getProperties(el, function (e, $prop) {
if (e) { return void logError(e); }
Cryptpad.alert('', undefined, true);
$('.alertify .msg').html("").append($prop);
Cryptpad.alert($prop[0], undefined, true);
});
}
module.hideMenu();