Skip to content

Commit

Permalink
[jan] Fix address autocompletion in redirection window of smartmobile…
Browse files Browse the repository at this point in the history
… mode (Bug #14002).
  • Loading branch information
yunosh committed Jun 2, 2015
1 parent 27f7738 commit b0dcc33
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
2 changes: 2 additions & 0 deletions imp/docs/CHANGES
Expand Up @@ -2,6 +2,8 @@
v6.2.9-git
----------

[jan] Fix address autocompletion in redirection window of smartmobile mode
(Bug #14002).
[jan] Fix setting single recipients in redirection window in basic mode (Bug
#14002).
[jan] Don't switch to regular compose view after an error in the redirection
Expand Down
22 changes: 11 additions & 11 deletions imp/js/smartmobile.js
Expand Up @@ -1015,8 +1015,8 @@ var ImpMobile = {
$('#compose .smartmobile-title').html(IMP.text.new_message);

if (purl.params.to || purl.params.cc) {
ImpMobile.addAddress('to', purl.params.to);
ImpMobile.addAddress('cc', purl.params.cc);
ImpMobile.addAddress('compose-to', purl.params.to);
ImpMobile.addAddress('compose-cc', purl.params.cc);
}

$('#imp-compose-form').show();
Expand Down Expand Up @@ -1095,10 +1095,10 @@ var ImpMobile = {

if (r.addr) {
$.each(r.addr.to, function(k, v) {
ImpMobile.addAddress('to', v);
ImpMobile.addAddress('compose-to', v);
});
$.each(r.addr.cc, function(k, v) {
ImpMobile.addAddress('cc', v);
ImpMobile.addAddress('compose-cc', v);
});
}

Expand Down Expand Up @@ -1157,9 +1157,9 @@ var ImpMobile = {
addAddress: function(f, addr)
{
if (addr) {
$('#imp-compose-' + f + '-addr').prepend(
$('#imp-' + f + '-addr').prepend(
$('<input></input>')
.attr('name', f + '[]')
.attr('name', (f == 'redirect-to' ? 'redirect_to' : f.substr(8)) + '[]')
.attr('type', 'hidden')
.val(addr)
).prepend(
Expand Down Expand Up @@ -1199,7 +1199,7 @@ var ImpMobile = {
if (!pos) {
val = val.substr(1);
} else if (val.charAt(pos - 1) != '\\') {
ImpMobile.addAddress($(this).attr('id') == 'imp-compose-to' ? 'to' : 'cc', $.trim(val.substr(0, chr == ';' ? pos + 1 : pos)));
ImpMobile.addAddress($(this).attr('id').substr(4), $.trim(val.substr(0, chr == ';' ? pos + 1 : pos)));
val = val.substr(pos + 2);
pos = 0;
}
Expand Down Expand Up @@ -1604,17 +1604,17 @@ var ImpMobile = {
});
});

$.each([ 'to', 'cc' ], function(undefined, v) {
$('#imp-compose-' + v)
$.each([ 'compose-to', 'compose-cc', 'redirect-to' ], function(undefined, v) {
$('#imp-' + v)
.autocomplete({
callback: function(e) {
ImpMobile.addAddress(v, $.trim($(e.currentTarget).text()));
$('#imp-compose-' + v).val('');
$('#imp-' + v).val('');
},
link: '#',
minLength: 3,
source: 'smartmobileAutocomplete',
target: $('#imp-compose-' + v + '-suggestions')
target: $('#imp-' + v + '-suggestions')
})
// textchange plugin requires bind()
.bind('textchange', ImpMobile.processComposeAddress);
Expand Down
2 changes: 2 additions & 0 deletions imp/package.xml
Expand Up @@ -33,6 +33,7 @@
</stability>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
* [jan] Fix address autocompletion in redirection window of smartmobile mode (Bug #14002).
* [jan] Fix setting single recipients in redirection window in basic mode (Bug #14002).
* [jan] Don&apos;t switch to regular compose view after an error in the redirection view in basic mode.
* [jan] Fix cancelling redirection window in basic mode (Bug #14002).
Expand Down Expand Up @@ -3846,6 +3847,7 @@
<date>2015-04-28</date>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
* [jan] Fix address autocompletion in redirection window of smartmobile mode (Bug #14002).
* [jan] Fix setting single recipients in redirection window in basic mode (Bug #14002).
* [jan] Don&apos;t switch to regular compose view after an error in the redirection view in basic mode.
* [jan] Fix cancelling redirection window in basic mode (Bug #14002).
Expand Down
6 changes: 5 additions & 1 deletion imp/templates/smartmobile/compose.html.php
Expand Up @@ -5,7 +5,11 @@
<form id="imp-redirect-form" style="display:none">
<input type="hidden" id="imp-redirect-cache" name="composeCache" value="<?php echo $this->h($this->composeCache) ?>" />
<label for="imp-redirect-to"><?php echo _("To:") ?></label>
<input type="text" id="imp-redirect-to" name="redirect_to" />
<div class="imp-compose-addr-div">
<input type="text" id="imp-redirect-to" name="redirect_to[]" />
<ul id="imp-redirect-to-suggestions" data-role="listview" data-inset="true"></ul>
<div id="imp-redirect-to-addr"></div>
</div>
</form>

<form id="imp-compose-form">
Expand Down

0 comments on commit b0dcc33

Please sign in to comment.