Fix regression where UI object could be not created on some pages (#5484)

pull/5490/head
Aleksander Machniak 8 years ago
parent 571a10751f
commit edea8732a6

@ -1096,6 +1096,10 @@ EOF;
}
break;
case 'add_label':
$this->add_label($attrib['name']);
break;
// include a file
case 'include':
$old_base_path = $this->base_path;

@ -1,2 +1,5 @@
<roundcube:object name="message" id="messagestack" condition="env:task != 'login'" />
<script type="text/javascript">
if (!window.UI) { var UI = new rcube_mail_ui(); }
</script>

@ -1,13 +1,5 @@
<script type="text/javascript">
// UI startup
var UI = new rcube_mail_ui();
$(document).ready(function(){
UI.set('errortitle', '<roundcube:label name="errortitle" quoting="javascript" />');
UI.set('toggleoptions', '<roundcube:label name="toggleadvancedoptions" quoting="javascript" />');
UI.init();
});
</script>
<div id="header">

@ -4,4 +4,6 @@
<roundcube:if condition="in_array(env:task, array('mail','addressbook','settings'))" />
<link rel="stylesheet" type="text/css" href="/<roundcube:var name="env:task" />.css" />
<roundcube:endif />
<script type="text/javascript" src="/ui.js"></script>
<script type="text/javascript" src="/ui.js"></script>
<roundcube:add_label name="errortitle" />
<roundcube:add_label name="toggleadvancedoptions" />

@ -60,6 +60,8 @@ function rcube_mail_ui()
if (bw.tablet) {
$('#viewport').attr('content', "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0");
}
$(document).ready(function() { me.init(); });
}
@ -288,8 +290,8 @@ function rcube_mail_ui()
else if (rcmail.env.action == 'edit-prefs') {
var legend = $('#preferences-details fieldset.advanced legend'),
toggle = $('<a href="#toggle"></a>')
.text(env.toggleoptions)
.attr('title', env.toggleoptions)
.text(rcmail.gettext('toggleadvancedoptions'))
.attr('title', rcmail.gettext('toggleadvancedoptions'))
.addClass('advanced-toggle');
legend.click(function(e) {
@ -449,7 +451,7 @@ function rcube_mail_ui()
resizable: false,
closeOnEscape: true,
dialogClass: 'popupmessage ' + p.type,
title: env.errortitle,
title: rcmail.gettext('errortitle'),
close: dialog_close,
hide: {effect: 'fadeOut'},
width: 420,

Loading…
Cancel
Save