Mobile support for the new toolbar

This commit is contained in:
yflory
2017-06-23 17:56:14 +02:00
parent b4b851959f
commit 0d4d104e08
8 changed files with 250 additions and 102 deletions

View File

@@ -849,7 +849,7 @@ define([
var $limit = $('<span>', {'class': 'cryptpad-limit-bar'}).appendTo($container);
var quota = usage/limit;
var width = Math.floor(Math.min(quota, 1)*200); // the bar is 200px width
var width = Math.floor(Math.min(quota, 1)*$limit.width()); // the bar is 200px width
var $usage = $('<span>', {'class': 'usage'}).css('width', width+'px');
var makeDonateButton = function () {
@@ -864,15 +864,12 @@ define([
};
var makeUpgradeButton = function () {
var $upgradeLink = $('<a>', {
$('<a>', {
'class': 'upgrade btn btn-success',
href: common.upgradeURL,
rel: "noreferrer noopener",
target: "_blank",
}).appendTo($container);
$('<button>', {
'class': 'upgrade buttonSuccess',
title: Messages.upgradeTitle
}).text(Messages.upgradeAccount).appendTo($upgradeLink);
}).text(Messages.upgradeAccount).appendTo($container);
};
if (!Config.removeDonateButton) {

View File

@@ -498,6 +498,7 @@ define([
var displayInput = function () {
if (toolbar.connected === false) { return; }
$input.width(Math.max($text.width(), 300)+'px');
$text.hide();
//$pencilIcon.css('display', 'none');
var inputVal = suggestName() || "";
@@ -741,7 +742,8 @@ define([
};
var createUpgrade = function (toolbar) {
if (ApiConfig.removeDonateButton) { return; }
return; // TODO
/*if (ApiConfig.removeDonateButton) { return; }
if (Cryptpad.account.plan) { return; }
var text;
@@ -764,7 +766,7 @@ define([
Cryptpad.feedback(feedback);
window.open(url,'_blank');
});
return $upgrade;
return $upgrade;*/
};
// Events