mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 23:46:14 -04:00
Pad: Disable toolbar and import/export when reconnecting
This commit is contained in:
parent
6f28e415ec
commit
5ac5b65aff
2 changed files with 10 additions and 2 deletions
|
@ -222,7 +222,6 @@ function handshake()
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on('reconnecting', function() {
|
socket.on('reconnecting', function() {
|
||||||
padeditor.disable();
|
|
||||||
pad.collabClient.setStateIdle();
|
pad.collabClient.setStateIdle();
|
||||||
pad.collabClient.setIsPendingRevision(true);
|
pad.collabClient.setIsPendingRevision(true);
|
||||||
pad.collabClient.setChannelState("RECONNECTING");
|
pad.collabClient.setChannelState("RECONNECTING");
|
||||||
|
@ -752,10 +751,15 @@ var pad = {
|
||||||
if (newState == "CONNECTED")
|
if (newState == "CONNECTED")
|
||||||
{
|
{
|
||||||
padeditor.enable();
|
padeditor.enable();
|
||||||
|
padeditbar.enable();
|
||||||
|
padimpexp.enable();
|
||||||
padconnectionstatus.connected();
|
padconnectionstatus.connected();
|
||||||
}
|
}
|
||||||
else if (newState == "RECONNECTING")
|
else if (newState == "RECONNECTING")
|
||||||
{
|
{
|
||||||
|
padeditor.disable();
|
||||||
|
padeditbar.disable();
|
||||||
|
padimpexp.disable();
|
||||||
padconnectionstatus.reconnecting();
|
padconnectionstatus.reconnecting();
|
||||||
}
|
}
|
||||||
else if (newState == "DISCONNECTED")
|
else if (newState == "DISCONNECTED")
|
||||||
|
|
|
@ -146,7 +146,7 @@ var padeditbar = (function()
|
||||||
self.dropdowns = [];
|
self.dropdowns = [];
|
||||||
|
|
||||||
$("#editbar .editbarbutton").attr("unselectable", "on"); // for IE
|
$("#editbar .editbarbutton").attr("unselectable", "on"); // for IE
|
||||||
$("#editbar").removeClass("disabledtoolbar").addClass("enabledtoolbar");
|
this.enable();
|
||||||
$("#editbar [data-key]").each(function () {
|
$("#editbar [data-key]").each(function () {
|
||||||
$(this).unbind("click");
|
$(this).unbind("click");
|
||||||
(new ToolbarItem($(this))).bind(function (command, item) {
|
(new ToolbarItem($(this))).bind(function (command, item) {
|
||||||
|
@ -194,6 +194,10 @@ var padeditbar = (function()
|
||||||
{
|
{
|
||||||
$("#editbar").addClass('disabledtoolbar').removeClass("enabledtoolbar");
|
$("#editbar").addClass('disabledtoolbar').removeClass("enabledtoolbar");
|
||||||
},
|
},
|
||||||
|
enable: function()
|
||||||
|
{
|
||||||
|
$('#editbar').addClass('enabledtoolbar').removeClass('disabledtoolbar');
|
||||||
|
},
|
||||||
commands: {},
|
commands: {},
|
||||||
registerCommand: function (cmd, callback) {
|
registerCommand: function (cmd, callback) {
|
||||||
this.commands[cmd] = callback;
|
this.commands[cmd] = callback;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue