Style the reconnect banner, clean up apply usage
This commit is contained in:
parent
ca5542e46d
commit
7029511029
4 changed files with 13 additions and 8 deletions
|
@ -267,11 +267,13 @@ td.time {
|
||||||
top: 35px;
|
top: 35px;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
background-color: #eee;
|
width: 80%;
|
||||||
color: #333;
|
|
||||||
width: 100%;
|
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
|
left: 10%;
|
||||||
|
}
|
||||||
|
#reconnect a {
|
||||||
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer {
|
.footer {
|
||||||
|
|
|
@ -289,15 +289,17 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table><span id="end-of-buffer"></span>
|
</table><span id="end-of-buffer"></span>
|
||||||
<div id="reconnect" ng-if="reconnecting">
|
|
||||||
<i class="glyphicon glyphicon-refresh"></i> Reconnecting... <a ng-click="reconnect()">Try now</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="footer" ng-class="{'withnicklist': showNicklist}">
|
<div class="footer" ng-class="{'withnicklist': showNicklist}">
|
||||||
<div input-bar input-id="sendMessage" command="command"></div>
|
<div input-bar input-id="sendMessage" command="command"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="soundNotification"></div>
|
<div id="soundNotification"></div>
|
||||||
|
<div id="reconnect" class="alert alert-danger" ng-click="reconnect()" ng-show="reconnecting">
|
||||||
|
<p><strong>Connection to WeeChat lost</strong></p>
|
||||||
|
<i class="glyphicon glyphicon-refresh"></i>
|
||||||
|
Reconnecting... <a class="btn btn-tiny" ng-click="reconnect()">Click to try to reconnect now</a>
|
||||||
|
</div>
|
||||||
<div id="settingsModal" class="gb-modal" data-state="hidden">
|
<div id="settingsModal" class="gb-modal" data-state="hidden">
|
||||||
<div class="backdrop" ng-click="closeModal($event)"></div>
|
<div class="backdrop" ng-click="closeModal($event)"></div>
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
|
|
|
@ -184,10 +184,10 @@ weechat.factory('connection',
|
||||||
$log.info('Attempting to reconnect...');
|
$log.info('Attempting to reconnect...');
|
||||||
var d = connectionData;
|
var d = connectionData;
|
||||||
connect(d[0], d[1], d[2], d[3], d[4], function() {
|
connect(d[0], d[1], d[2], d[3], d[4], function() {
|
||||||
|
$rootScope.reconnecting = false;
|
||||||
// on success, update active buffer
|
// on success, update active buffer
|
||||||
models.setActiveBuffer(bufferId);
|
models.setActiveBuffer(bufferId);
|
||||||
$log.info('Sucessfully reconnected to relay');
|
$log.info('Sucessfully reconnected to relay');
|
||||||
$rootScope.reconnecting = false;
|
|
||||||
}, function() {
|
}, function() {
|
||||||
// on failure, schedule another attempt
|
// on failure, schedule another attempt
|
||||||
if (timeout >= 600000) {
|
if (timeout >= 600000) {
|
||||||
|
@ -217,6 +217,8 @@ weechat.factory('connection',
|
||||||
}
|
}
|
||||||
|
|
||||||
$rootScope.reconnecting = true;
|
$rootScope.reconnecting = true;
|
||||||
|
// Have to do this to get the reconnect banner to show
|
||||||
|
$rootScope.$apply();
|
||||||
|
|
||||||
var bufferId = models.getActiveBuffer().id,
|
var bufferId = models.getActiveBuffer().id,
|
||||||
timeout = 3000; // start with a three-second timeout
|
timeout = 3000; // start with a three-second timeout
|
||||||
|
|
|
@ -110,7 +110,6 @@ function($rootScope, $q) {
|
||||||
$rootScope.$emit('onMessage', message);
|
$rootScope.$emit('onMessage', message);
|
||||||
}
|
}
|
||||||
|
|
||||||
$rootScope.$apply();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var connect = function(url,
|
var connect = function(url,
|
||||||
|
|
Loading…
Reference in a new issue