Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't use env for group-rename action #5652

Merged
merged 4 commits into from
Feb 20, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions program/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6195,13 +6195,14 @@ function rcube_webmail()
this.group_create = function()
{
var input = $('<input>').attr('type', 'text'),
content = $('<label>').text(this.get_label('namex')).append(input);
content = $('<label>').text(this.get_label('namex')).append(input),
source = this.env.source;

this.simple_dialog(content, 'newgroup',
function() {
var name;
if (name = input.val()) {
ref.http_post('group-create', {_source: ref.env.source, _name: name},
ref.http_post('group-create', {_source: source, _name: name},
ref.set_busy(true, 'loading'));
return true;
}
Expand All @@ -6216,13 +6217,15 @@ function rcube_webmail()

var group_name = this.env.contactgroups['G' + this.env.source + this.env.group].name,
input = $('<input>').attr('type', 'text').val(group_name),
content = $('<label>').text(this.get_label('namex')).append(input);
content = $('<label>').text(this.get_label('namex')).append(input),
source = this.env.source,
group = this.env.group;

this.simple_dialog(content, 'grouprename',
function() {
var name;
if ((name = input.val()) && name != group_name) {
ref.http_post('group-rename', {_source: ref.env.source, _gid: ref.env.group, _name: name},
ref.http_post('group-rename', {_source: source, _gid: group, _name: name},
ref.set_busy(true, 'loading'));
return true;
}
Expand Down Expand Up @@ -6320,7 +6323,9 @@ function rcube_webmail()
else {
$(this.treelist.get_item(key)).children().first().html(prop.name);
this.env.contactfolders[key].name = this.env.contactgroups[key].name = prop.name;
this.set_group_prop(prop);

if (prop.id == this.env.group)
this.set_group_prop(prop);
}

// update list node and re-sort it
Expand Down