From: Jan Schneider Date: Tue, 9 Mar 2010 22:44:26 +0000 (+0100) Subject: Fix a few buglets with the basic permission screen. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=59c6f4a04df933e5277389780c723daf0f937022;p=horde.git Fix a few buglets with the basic permission screen. --- diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index 2d80767dd..b0f724583 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -2292,6 +2292,10 @@ KronolithCore = { $('kronolithCalendarPermsAdvanced') .select('input[type=checkbox]') .invoke('setValue', 0); + $('kronolithCalendarPermsAdvanced').select('tr').findAll(function(tr) { + return tr.retrieve('remove'); + }).invoke('remove'); + switch (perm) { case 'None': $('kronolithCalendarPermsAllShow').disable(); @@ -2319,7 +2323,7 @@ KronolithCore = { var group = $F('kronolithCalendarPermsGroupSingle') ? $F('kronolithCalendarPermsGroupSingle') : $F('kronolithCalendarPermsGroupList'); - this.insertGroupOrUser('group', group); + this.insertGroupOrUser('group', group, true); $('kronolithCalendarPermsGroupshow_' + group).setValue(1); $('kronolithCalendarPermsGroupread_' + group).setValue(1); if ($F('kronolithCalendarPermsGroupPerms') == 'edit') { @@ -2431,9 +2435,11 @@ KronolithCore = { case 'all_read': $('kronolithCalendarPermsAll').setValue(1); $('kronolithCalendarPermsAllShow').setValue(0); + break; case 'all_show': $('kronolithCalendarPermsAll').setValue(1); $('kronolithCalendarPermsAllShow').setValue(1); + break; case 'group_read': case 'group_edit': var setGroup = function(group) { @@ -2457,6 +2463,7 @@ KronolithCore = { $('kronolithCalendarPermsGroupPerms').setValue(basic.substring(6)); $('kronolithCalendarPermsAdvanced').hide(); $('kronolithCalendarPermsBasic').show(); + break; } } }, @@ -2524,11 +2531,13 @@ KronolithCore = { /** * Inserts a group or user row into the advanced permissions interface. * - * @param what string Either 'group' or 'user'. - * @param group string The group id or user name to insert. Defaults to - * the value of the drop down. + * @param what string Either 'group' or 'user'. + * @param group string The group id or user name to insert. + * Defaults to the value of the drop down. + * @param notadvanced boolean Enforces to NOT switch to the advanced + * permissions screen. */ - insertGroupOrUser: function(what, id) + insertGroupOrUser: function(what, id, notadvanced) { var elm = $(what == 'user' ? 'kronolithCalendarPermsUserNew' : 'kronolithCalendarPermsGroupNew'); if (id) { @@ -2564,7 +2573,9 @@ KronolithCore = { elm.clear(); } - this.activateAdvancedPerms(); + if (!notadvanced) { + this.activateAdvancedPerms(); + } }, /** @@ -3162,7 +3173,6 @@ KronolithCore = { case 'kronolithCalendarPermsAllShow': this.permsClickHandler('All'); - e.stop(); return; case 'kronolithCalendarPermsAdvanced':