Ticket #16059: 16059-filteredselectmultiple-better-ui.4.diff

File 16059-filteredselectmultiple-better-ui.4.diff, 22.9 KB (added by Julien Phalip, 13 years ago)
  • django/contrib/admin/static/admin/css/widgets.css

    diff --git a/django/contrib/admin/static/admin/css/widgets.css b/django/contrib/admin/static/admin/css/widgets.css
    index 4f4ea0a..7447248 100644
    a b  
    1717    margin-bottom: 5px;
    1818}
    1919
     20.selector-chosen select {
     21    border-top: none;
     22}
     23
    2024.selector-available h2, .selector-chosen h2 {
    2125    border: 1px solid #ccc;
    2226}
     
    3741    text-align: left;
    3842}
    3943
    40 .selector .selector-chosen .selector-filter {
    41     padding: 4px 5px;
     44.selector .selector-filter label {
     45    width: 16px;
     46    padding: 2px;
    4247}
    4348
    4449.selector .selector-available input {
     
    5055    width: 22px;
    5156    height: 50px;
    5257    background: url(../img/chooser-bg.gif) top center no-repeat;
    53     margin: 8em 3px 0 3px;
     58    margin: 10em 5px 0 5px;
    5459    padding: 0;
    5560}
    5661
     
    6166}
    6267
    6368.selector select {
    64     margin-bottom: 5px;
     69    margin-bottom: 10px;
    6570    margin-top: 0;
    6671}
    6772
     
    7479}
    7580
    7681.selector-add {
    77     background: url(../img/selector-add.gif) top center no-repeat;
     82    background: url(../img/selector-icons.gif) 0 -161px no-repeat;
     83    cursor: default;
    7884    margin-bottom: 2px;
    7985}
    8086
     87.selector-add.active {
     88    background: url(../img/selector-icons.gif) 0 -187px no-repeat;
     89    cursor: pointer;
     90}
     91
    8192.selector-remove {
    82     background: url(../img/selector-remove.gif) top center no-repeat;
     93    background: url(../img/selector-icons.gif) 0 -109px no-repeat;
     94    cursor: default;
     95}
     96
     97.selector-remove.active {
     98    background: url(../img/selector-icons.gif) 0 -135px no-repeat;
     99    cursor: pointer;
    83100}
    84101
    85102a.selector-chooseall, a.selector-clearall {
    86     display: block;
    87     width: 6em;
     103    display: inline-block;
    88104    text-align: left;
    89105    margin-left: auto;
    90106    margin-right: auto;
    91107    font-weight: bold;
    92108    color: #666;
     109}
     110
     111a.selector-chooseall {
     112    padding: 3px 18px 3px 0;
     113}
     114
     115a.selector-clearall {
    93116    padding: 3px 0 3px 18px;
    94117}
    95118
    96 a.selector-chooseall:hover, a.selector-clearall:hover {
     119a.selector-chooseall.active:hover, a.selector-clearall.active:hover {
    97120    color: #036;
    98121}
    99122
    100123a.selector-chooseall {
    101     width: 7em;
    102     background: url(../img/selector-addall.gif) left center no-repeat;
     124    background: url(../img/selector-icons.gif) right -263px no-repeat;
     125    cursor: default;
     126}
     127
     128a.selector-chooseall.active {
     129    background: url(../img/selector-icons.gif) right -289px no-repeat;
     130    cursor: pointer;
    103131}
    104132
    105133a.selector-clearall {
    106     background: url(../img/selector-removeall.gif) left center no-repeat;
     134    background: url(../img/selector-icons.gif) left -211px no-repeat;
     135    cursor: default;
    107136}
    108137
     138a.selector-clearall.active {
     139    background: url(../img/selector-icons.gif) left -237px no-repeat;
     140    cursor: pointer;
     141}
    109142
    110143/* STACKED SELECTORS */
    111144
    a.selector-clearall {  
    148181}
    149182
    150183.stacked .selector-add {
    151     background-image: url(../img/selector_stacked-add.gif);
     184    background: url(../img/selector-icons.gif) 0 -57px no-repeat;
     185    cursor: default;
     186}
     187
     188.stacked .selector-add.active {
     189    background: url(../img/selector-icons.gif) 0 -83px no-repeat;
     190    cursor: pointer;
    152191}
    153192
    154193.stacked .selector-remove {
    155     background-image: url(../img/selector_stacked-remove.gif);
     194    background: url(../img/selector-icons.gif) 0 -5px no-repeat;
     195    cursor: default;
    156196}
    157197
     198.stacked .selector-remove.active {
     199    background: url(../img/selector-icons.gif) 0 -31px no-repeat;
     200    cursor: pointer;
     201}
    158202
    159203/* DATE AND TIME */
    160204
  • deleted file django/contrib/admin/static/admin/img/selector-add.gif

    diff --git a/django/contrib/admin/static/admin/img/selector-add.gif b/django/contrib/admin/static/admin/img/selector-add.gif
    deleted file mode 100644
    index 50132d1c439494a0a19e1d280385f03d3ac5599b..0000000000000000000000000000000000000000
    GIT binary patch
    literal 0
    HcmV?d00001
  • deleted file literal

    literal 606
    zcmZ?wbhEHb6krfwcoxafw(@M}n)ChZFW!3c{`tGF)3#h)y!U$bf@7^KPS-6uzUAco
    zS0BDVc=>6^`De|`PR`nSy<y48zyJQd`}||`iF+NZ&i1W6H+j>g_g{XjI&`ak@yUG`
    zo;EK(J#+ijhQ%lP*I%ezbo}9~&(pSE*?IQS;=MN)@4Gd3=e3%J$D5X(nz`fp(*3u$
    zoqaNI*R}d3CpVpX{Q29jre&vU7apIr<J!lsKewH_U$^+g#EqBw)?Il0;oG*ePnYb!
    z-Lm4$p)1etJp0(S=G=@OK%<WJZ@Ad7<ka-7SK3#edGqP}{5>~bzW=sp-|cz3uWvc?
    zWa{QC$8Wq`dhpJqjhE{epV)Z(?&i~vr*FGDch`+I#~w`He7Swq*`){W^sT@6^~dl3
    z|Nk@49Vq@}VPs&4WY7WG42ly5_T3GUO_4kje3Fi`Y|PEgg2Ei`p1iykJ|h0&z5Zgl
    z0rM9G$k+=tamfX*T&cAxSkXVyMZhv_>sB}KZDAbD#%4hW4zfg89~5H~^<`z%<UXet
    z5g~Qji=C6{hVsSR7nN=pa56sfxO3a}k(#I#1A`OGd!vi0Zy4CQ^h1CCQi#z0CC!#s
    zv%_hF0>2RJ`V9$77#OFv^CvqjY0A7XSuxNk>&%VE4w{br3Jf1VK49#UQa3Uc3OT{Z
    NtIjEA%EiK94FJ;24lMux
    
    diff --git a/django/contrib/admin/static/admin/img/selector-addall.gif b/django/contrib/admin/static/admin/img/selector-addall.gif
    deleted file mode 100644
    index d6e7c639bb2ec270122861f054289845281fae26..0000000000000000000000000000000000000000
    GIT binary patch
    literal 0
    HcmV?d00001
  • new file 358

    literal 358
    zcmZ?wbhEHb6krfwxN64GwdVYqV-FVYy|wM^)3z0-CvU#|?Z@x7m1n1IyE0+p#RUf*
    z*DpEQwCq&t%5&3q-kG-LYR}pWx1PLjUwNi;)tTmHr>AYX(!J*V^leu=SD$TPd3wsG
    zD~tDD-+uc3vi-Mqo_}`i`pffoUcPz%`N)+gC$B$Wu={53y7Nb`JiYSZ&E<QqzJ2?C
    z>gJ2jU%oBgck}JXFNZEY-hSr6{b%p@TzI-@&-ELR-)%g8_xtzn|NsAIzzr0CvM@3*
    zm@(*plz{xiz}D<AyTC(7s^23z#dv0pk_YqJhXEQgyt58^?B=nX*Z9Lp`<y}Jft8}(
    z>;}e*)+h-yWNC)(RZ<o*;pbO2Z81=hVyP1o5KwC|Rg@L$bT$%UXV+`dP-PdXbvEW^
    uU{KPQS;D|w=wc$os;|SkSt!*th=-GdgOex9!`Mht(rAt6@e{6&4AuaOP^lOI
    
    diff --git a/django/contrib/admin/static/admin/img/selector-icons.gif b/django/contrib/admin/static/admin/img/selector-icons.gif
    new file mode 100644
    index 0000000000000000000000000000000000000000..8809c4fb9acea53623b8e3b8251b72a245aa17e8
    GIT binary patch
    literal 2771
    zcmV;^3M}<UNk%w1VGsZ~0rvm^{{H^`{{H;^{rUO%`1ttu_xJVq`}X+z_V)Jn_xSeq
    z_x1Mp^!E7k_WJSl`S0}j^Yr%a^Z4@e^6~NU?DF^R@$~TU@a*yT>+$#R@9*pI_UiEW
    z?C<mL?(XUD_UG>P?Ck95?C|R9>g4S7<LmS0>hI*~?c(b5<>~I>>hs{~^5^I0=I80;
    z=IGz%@8ag`<>lq%<mBAu@#Ev;+U4-t<nP$y?%?3y)Zpyi-rn8a-P7Lc)!gLO+~eEZ
    z+t1wT+S=OL+1c3G*w@$B%Gv1F*4D|_=hfBK&(_|@*y+^N)W+B8&eq+>*5<_4=+e^C
    z#nk1*)a1g{=h4y8!qVf<&(F@z&b-j%ywK&%&CR~h<;={?xX<Rf&*sa^%el?s%F4>N
    z&E(0+$+peq$jHdI%ip)m;Iz!+w9MqT%HPMw$F$4hwaenO%j2}k;Izu%vdZJM$=|Zc
    z;j_rz#Kgq1$KA2V-NVDftj6HN!otD9!KlRGz`(%2zrU)&+P=QNr@`C2yu78s+@-+W
    zroh{!z}uj}<EFpbq`%vxzuUXJyR*E;y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mV?d00001
    
    diff --git a/django/contrib/admin/static/admin/img/selector-remove.gif b/django/contrib/admin/static/admin/img/selector-remove.gif
    deleted file mode 100644
    index 2b9b0a2ac35a2051834bb9a49a7d57aaeebdcb48..0000000000000000000000000000000000000000
    GIT binary patch
    literal 0
    HcmV?d00001
  • deleted file literal

    literal 398
    zcmV;90df9ENk%w1VGsZi0M$MK!NI}2yu9=C^R%?Iv9Ynv*4?eOy|A&e#l^+DySw1v
    z;PCM9vb)91%*?sDx%~b8tgyARva;st@73Jn!^6YAzP`)L%gV~i`T6;>yTq=rvah$l
    z-QC^j?C`?E!rI!}-rnBp>+8?Y&$F|$v%JQ(wzkK|$N2d8?d|R4>Fx3H@xZ{qud%ZB
    z_V&`!(&Fap*x1<3&CRj8!??J(+uPg8$;r;n&b76*)z#I=$jG<1x5UK6zrVlr`1}9=
    z{{R30A^8LW002G!EC2ui01yBW000K7K%dYz*=R~SmZ2~lJ~9pwN1*_@60%NHMxlAX
    zUK2qgWbklk^e2tm$$Y6>%tp5<1a<nXK&s^aIUGGIfPVl65Ig{jFg-md0+AO0D+C7t
    zm^h9-7@Ikm5eGA)2%DXb2%`}Y12?V|jx7tbJgx)`13J1or6{|)HwG^wJjKNpA;!f6
    sObiY?(9k*2J6J<92{qc=+7)9?88;pm4Gk7MI$2FZMH;OKOHDxlJ9N|8EC2ui
    
    diff --git a/django/contrib/admin/static/admin/img/selector-removeall.gif b/django/contrib/admin/static/admin/img/selector-removeall.gif
    deleted file mode 100644
    index 5a4421926d9c352abcf3b114ccd296197b9c9fdf..0000000000000000000000000000000000000000
    GIT binary patch
    literal 0
    HcmV?d00001
  • deleted file literal

    literal 355
    zcmZ?wbhEHb6krfwxT?c&_3G8rr%&(Szkl`W)oa$Q*|TTQ&6_u`UAuPg-o0hZmTlU!
    z>Bx~ID^{#HdGh3{RjW2`-1y|llXdIX?cBNZ+_`frSFT*Tbm`{Jn=f9xc=ztz_wV0-
    z|Ni~?^XIp2-MVq(#`*K-_wCzv>C&Zd-@aYHe*MaoE4y~>`t<43?%lh$ZQJ(v@#E#o
    zmmfcV{Kt<U|NsAIAQve9WMO1r&;ddq0Qrf5t-)bhfrpM%zlYcohlL^vC#Gs$vXGGy
    zyn1TIB!+!TEDnpb7O^#&ENJoK4{*8csqi2pOybu`7av;>Y3(LiF)@D4T0VKnCT(SA
    zX1)$*HBn6#jwS_7P0<=>4NmpN;)-mGISX90xU|;Ev8_pU4PxOI7UpJ&^3YJ@;Za-V
    LdE}_8BZD;nhnJNG
    
    diff --git a/django/contrib/admin/static/admin/img/selector_stacked-add.gif b/django/contrib/admin/static/admin/img/selector_stacked-add.gif
    deleted file mode 100644
    index 74261696522de5819780082d9d92d75f8ffdb4fc..0000000000000000000000000000000000000000
    GIT binary patch
    literal 0
    HcmV?d00001
  • deleted file literal

    literal 612
    zcmZ?wbhEHb6krfwcoxdgw({()C+`>Uz23RzeCvwSk6wMQUT~~#(eW)O@4x%}qhZO(
    z=4B^W9lAAn)1{a1zimDJ=;PO)eQVFX`tbe1%TKd*UVs1P$KQYdUVr@FvFhyR6ZdwU
    ze>P#`rA;RvPThQ^Vacg^yRJ>!dS%hR+gr{&*>?76|N09vw_ojAb8ha=YxRpy&e(CS
    zX5q0dryguM`QY`3Zw-r2%-nIkdHLz4Wv6Nu9$&Km_M1=N`!`%%e(?6hjhE^cpICbE
    zPW_UT?JLi0J9WQr-Gy6EKkPjFXz{*VlQv#%T6(H>;qm&#Ct6mV*>vi0?V{s*E<9;p
    zb#~+NyGsw;*?ju(++8>N)?b{q<?7_km#1&Ly5`t}{`D8X{`md>|9^%71&Tje7#SEs
    z8FWCd0L2Ld`@x3LrchxXZVfp-CdTGwF-aChB`GOoO9?O0UN2rZpZN=XRJAypI8=gG
    zu3D|&6>7p|?7dlrpI>J4W)?;pTi^Y@;vpg82Yh*%1Red)_zN8tI_odX#vXkAI^SWw
    z8`quLnIE#U3LF+-wUd@+HWGAYV9+`IIYj*f0~?2-=O67a@_!~B5V-KDV{)@!9S?KU
    zg-$*<4i1Nz9ITzZT>%EXL7SAjj`z#?N@%FQnAjwxsS!|7=<Kn~t%*zbfa8+`i`*I+
    G7_0%~kOZIr
    
    diff --git a/django/contrib/admin/static/admin/img/selector_stacked-remove.gif b/django/contrib/admin/static/admin/img/selector_stacked-remove.gif
    deleted file mode 100644
    index 60412cee19c6b5d2ff5d1f86f765988ddddbb6dc..0000000000000000000000000000000000000000
    GIT binary patch
    literal 0
    HcmV?d00001
  • django/contrib/admin/static/admin/js/SelectFilter2.js

    literal 401
    zcmV;C0dD?BNk%w1VGsZi0M$GI!NI}K*4@0kyz%kzt+l<hw6w9YvAesw-QC^F%F434
    z#o*xJu(7i4?(VO*zpk*dxw*O3+~dH&z_PNk=IZaVyTteR_rAWq=<M+M`T6|){msqI
    z%*@QJu(j~;@Y2%K&(F`cwzlHt>*eL;*Vos_$H(O9?cUzr!^6YN%ge8^vckf`>gwvV
    zyvDP$v)I_!vAV;~&d%H0+sMes)z#I>$;r33x4*x?xVX5rwY9{=#P#_5|Ns9000000
    z00000A^8LW002AyEC2ui01yBW000KAK%S5naXdmc6(KMjYAO&AVzD@V4lqm;hLU-|
    z-jabLRNQE28e){D>0mrlZWF7McDqHrjtjIdGl3s?cnE<r00bR3000|=gfEQ}1`GlM
    z5-bfC85tH04LX+-3^=By19$_crV||nIk7n&cpkE`1_}i>yf&#j1HCpm1R^ds$Tu?y
    v2{Xwz1xyMMI@Q+KSVJ%eHQnCb7h_HpIV%Yq94R_BSxrJk53meNO+f%VqdU!B
    
    diff --git a/django/contrib/admin/static/admin/js/SelectFilter2.js b/django/contrib/admin/static/admin/js/SelectFilter2.js
    index b7bc9d5..2eb67e8 100644
    a b Different than SelectFilter because this is coupled to the admin framework.  
    55
    66Requires core.js, SelectBox.js and addevent.js.
    77*/
    8 
     8(function($) {
    99function findForm(node) {
    1010    // returns the node of the form containing the given node
    1111    if (node.tagName.toLowerCase() != 'form') {
    function findForm(node) {  
    1414    return node;
    1515}
    1616
    17 var SelectFilter = {
     17window.SelectFilter = {
    1818    init: function(field_id, field_name, is_stacked, admin_media_prefix) {
    1919        if (field_id.match(/__prefix__/)){
    2020            // Don't intialize on empty forms.
    var SelectFilter = {  
    4444        // <div class="selector-available">
    4545        var selector_available = quickElement('div', selector_div, '');
    4646        selector_available.className = 'selector-available';
    47         quickElement('h2', selector_available, interpolate(gettext('Available %s'), [field_name]));
    48         var filter_p = quickElement('p', selector_available, '');
     47        var title_available = quickElement('h2', selector_available, interpolate(gettext('Available %s') + ' ', [field_name]));
     48        quickElement('img', title_available, '', 'src', admin_media_prefix + 'img/icon-unknown.gif', 'width', '10', 'height', '10', 'class', 'help help-tooltip', 'title', interpolate(gettext('This is the list of available %s. You may add some by selecting them below and then clicking the "Add" button.'), [field_name]));
     49
     50        var filter_p = quickElement('p', selector_available, '', 'id', field_id + '_filter');
    4951        filter_p.className = 'selector-filter';
    5052
    51         var search_filter_label = quickElement('label', filter_p, '', 'for', field_id + "_input", 'style', 'width:16px;padding:2px');
     53        var search_filter_label = quickElement('label', filter_p, '', 'for', field_id + "_input");
    5254
    53         var search_selector_img = quickElement('img', search_filter_label, '', 'src', admin_media_prefix + 'img/selector-search.gif');
    54         search_selector_img.alt = gettext("Filter");
     55        var search_selector_img = quickElement('img', search_filter_label, '', 'src', admin_media_prefix + 'img/selector-search.gif', 'class', 'help-tooltip', 'alt', '', 'title', interpolate(gettext("Type into the filter box to narrow down the list of available %s."), [field_name]));
    5556
    5657        filter_p.appendChild(document.createTextNode(' '));
    5758
    58         var filter_input = quickElement('input', filter_p, '', 'type', 'text');
     59        var filter_input = quickElement('input', filter_p, '', 'type', 'text', 'placeholder', gettext("Filter"));
    5960        filter_input.id = field_id + '_input';
     61
    6062        selector_available.appendChild(from_box);
    61         var choose_all = quickElement('a', selector_available, gettext('Choose all'), 'href', 'javascript: (function(){ SelectBox.move_all("' + field_id + '_from", "' + field_id + '_to"); })()');
     63        var choose_all = quickElement('a', selector_available, gettext('Add all'), 'href', 'javascript: (function(){ SelectBox.move_all("' + field_id + '_from", "' + field_id + '_to"); SelectFilter.refresh_icons("' + field_id + '");})()', 'id', field_id + '_add_all_link');
    6264        choose_all.className = 'selector-chooseall';
    6365
    6466        // <ul class="selector-chooser">
    6567        var selector_chooser = quickElement('ul', selector_div, '');
    6668        selector_chooser.className = 'selector-chooser';
    67         var add_link = quickElement('a', quickElement('li', selector_chooser, ''), gettext('Add'), 'href', 'javascript: (function(){ SelectBox.move("' + field_id + '_from","' + field_id + '_to");})()');
     69        var add_link = quickElement('a', quickElement('li', selector_chooser, ''), gettext('Add'), 'title', gettext('Add'), 'href', 'javascript: (function(){ SelectBox.move("' + field_id + '_from","' + field_id + '_to"); SelectFilter.refresh_icons("' + field_id + '");})()', 'id', field_id + '_add_link');
    6870        add_link.className = 'selector-add';
    69         var remove_link = quickElement('a', quickElement('li', selector_chooser, ''), gettext('Remove'), 'href', 'javascript: (function(){ SelectBox.move("' + field_id + '_to","' + field_id + '_from");})()');
     71        var remove_link = quickElement('a', quickElement('li', selector_chooser, ''), gettext('Remove'), 'title', gettext('Remove'), 'href', 'javascript: (function(){ SelectBox.move("' + field_id + '_to","' + field_id + '_from"); SelectFilter.refresh_icons("' + field_id + '");})()', 'id', field_id + '_remove_link');
    7072        remove_link.className = 'selector-remove';
    7173
    7274        // <div class="selector-chosen">
    7375        var selector_chosen = quickElement('div', selector_div, '');
    7476        selector_chosen.className = 'selector-chosen';
    75         quickElement('h2', selector_chosen, interpolate(gettext('Chosen %s'), [field_name]));
    76         var selector_filter = quickElement('p', selector_chosen, gettext('Select your choice(s) and click '));
    77         selector_filter.className = 'selector-filter';
    78         quickElement('img', selector_filter, '', 'src', admin_media_prefix + (is_stacked ? 'img/selector_stacked-add.gif':'img/selector-add.gif'), 'alt', 'Add');
     77        var title_chosen = quickElement('h2', selector_chosen, interpolate(gettext('Added %s') + ' ', [field_name]));
     78        quickElement('img', title_chosen, '', 'src', admin_media_prefix + 'img/icon-unknown.gif', 'width', '10', 'height', '10', 'class', 'help help-tooltip', 'title', interpolate(gettext('This is the list of added %s. You may remove some by selecting them below and then clicking the "Remove" button.'), [field_name]));
     79
    7980        var to_box = quickElement('select', selector_chosen, '', 'id', field_id + '_to', 'multiple', 'multiple', 'size', from_box.size, 'name', from_box.getAttribute('name'));
    8081        to_box.className = 'filtered';
    81         var clear_all = quickElement('a', selector_chosen, gettext('Clear all'), 'href', 'javascript: (function() { SelectBox.move_all("' + field_id + '_to", "' + field_id + '_from");})()');
     82        var clear_all = quickElement('a', selector_chosen, gettext('Remove all'), 'href', 'javascript: (function() { SelectBox.move_all("' + field_id + '_to", "' + field_id + '_from"); SelectFilter.refresh_icons("' + field_id + '");})()', 'id', field_id + '_remove_all_link');
    8283        clear_all.className = 'selector-clearall';
    8384
    8485        from_box.setAttribute('name', from_box.getAttribute('name') + '_old');
    var SelectFilter = {  
    8687        // Set up the JavaScript event handlers for the select box filter interface
    8788        addEvent(filter_input, 'keyup', function(e) { SelectFilter.filter_key_up(e, field_id); });
    8889        addEvent(filter_input, 'keydown', function(e) { SelectFilter.filter_key_down(e, field_id); });
    89         addEvent(from_box, 'dblclick', function() { SelectBox.move(field_id + '_from', field_id + '_to'); });
    90         addEvent(to_box, 'dblclick', function() { SelectBox.move(field_id + '_to', field_id + '_from'); });
     90        addEvent(from_box, 'change', function(e) { SelectFilter.refresh_icons(field_id) });
     91        addEvent(to_box, 'change', function(e) { SelectFilter.refresh_icons(field_id) });
     92        addEvent(from_box, 'dblclick', function() { SelectBox.move(field_id + '_from', field_id + '_to'); SelectFilter.refresh_icons(field_id); });
     93        addEvent(to_box, 'dblclick', function() { SelectBox.move(field_id + '_to', field_id + '_from'); SelectFilter.refresh_icons(field_id); });
    9194        addEvent(findForm(from_box), 'submit', function() { SelectBox.select_all(field_id + '_to'); });
    9295        SelectBox.init(field_id + '_from');
    9396        SelectBox.init(field_id + '_to');
    9497        // Move selected from_box options to to_box
    9598        SelectBox.move(field_id + '_from', field_id + '_to');
     99
     100        if (!is_stacked) {
     101            // In horizontal mode, give the same height to the two boxes.
     102            $(to_box).height($(filter_p).outerHeight() + $(from_box).outerHeight());
     103        }
     104
     105        // Initial icon refresh
     106        SelectFilter.refresh_icons(field_id);
     107    },
     108    refresh_icons: function(field_id) {
     109        var from = $('#' + field_id + '_from');
     110        var to = $('#' + field_id + '_to');
     111        var is_from_selected = from.find('option:selected').length > 0;
     112        var is_to_selected = to.find('option:selected').length > 0;
     113        // Active if at least one item is selected
     114        $('#' + field_id + '_add_link').toggleClass('active', is_from_selected);
     115        $('#' + field_id + '_remove_link').toggleClass('active', is_to_selected);
     116        // Active if the corresponding box isn't empty
     117        $('#' + field_id + '_add_all_link').toggleClass('active', from.find('option').length > 0);
     118        $('#' + field_id + '_remove_all_link').toggleClass('active', to.find('option').length > 0);
    96119    },
    97120    filter_key_up: function(event, field_id) {
    98         from = document.getElementById(field_id + '_from');
     121        var from = document.getElementById(field_id + '_from');
    99122        // don't submit form if user pressed Enter
    100123        if ((event.which && event.which == 13) || (event.keyCode && event.keyCode == 13)) {
    101124            from.selectedIndex = 0;
    var SelectFilter = {  
    109132        return true;
    110133    },
    111134    filter_key_down: function(event, field_id) {
    112         from = document.getElementById(field_id + '_from');
     135        var from = document.getElementById(field_id + '_from');
    113136        // right arrow -- move across
    114137        if ((event.which && event.which == 39) || (event.keyCode && event.keyCode == 39)) {
    115138            var old_index = from.selectedIndex;
    var SelectFilter = {  
    128151        return true;
    129152    }
    130153}
     154
     155})(django.jQuery);
  • docs/releases/1.4.txt

    diff --git a/docs/releases/1.4.txt b/docs/releases/1.4.txt
    index d676ff0..a73d1af 100644
    a b In case your ``ADMIN_MEDIA_PREFIX`` is set to an own domain (e.g.  
    307307    that path. The files were moved from :file:`django/contrib/admin/media/`
    308308    to :file:`django/contrib/admin/static/admin/`.
    309309
     310Removed admin images
     311~~~~~~~~~~~~~~~~~~~~
     312
     313As part of an effort to improve the performance and usability of the admin's
     314vertical and horizontal "filter" interfaces, some image files were removed and
     315grouped into a single sprite file (``selector-icons.gif``):
     316``selector-add.gif``, ``selector-addall.gif``, ``selector-remove.gif``,
     317``selector-removeall.gif``, ``selector_stacked-add.gif`` and
     318``selector_stacked-remove.gif``. If you used those images to customize the
     319admin you will want to replace them with your own images.
     320
    310321Compatibility with old signed data
    311322~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    312323
Back to Top