Dotclear

Changeset 1819:55a1746826ea


Ignore:
Timestamp:
09/08/13 04:30:46 (12 years ago)
Author:
kevin@…
Branch:
Ticket #1539
Message:

Ticket #1539 : tester s'il existe des mots-clés dans le blog. S'il n'y en a pas, ne pas afficher "Choisir dans la liste".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/js/meta-editor.js

    r1741 r1819  
    113113      
    114114     addMetaDialog: function() { 
    115           var This = this; 
    116115           
    117116          if (this.submit_button == null) { 
     
    121120          } 
    122121           
    123           // View meta list 
    124           var a = $('<a href="#">' + this.text_choose + '</a>'); 
    125           a.click(function() { 
    126                This.showMetaList(metaEditor.prototype.meta_type,$(this).parent()); 
    127                return false; 
    128           }); 
    129122          if (this.text_separation != '') { 
    130123               this.target.append($('<p></p>').addClass('form-note').append(this.text_separation.replace(/%s/,this.meta_type))); 
    131124          } 
    132           this.target.append($('<p></p>').append(a)); 
     125           
     126          this.showMetaList(metaEditor.prototype.meta_type,this.target); 
     127           
    133128     }, 
    134129      
    135130     showMetaList: function(type,target) { 
    136           target.empty(); 
    137           target.append('...'); 
    138           target.addClass('addMeta'); 
    139131           
    140132          var params = { 
     
    151143           
    152144          $.get(this.service_uri,params,function(data) { 
     145                
     146               var pl = $('<p class="addMeta"></p>'); 
     147                
     148               $('.addMeta').remove(); 
     149                
    153150               if ($(data).find('meta').length > 0) { 
    154                     target.empty(); 
     151                    pl.empty(); 
    155152                    var meta_link; 
    156153                     
     
    165162                          
    166163                         if (i>0) { 
    167                               target.append(', '); 
     164                              pl.append(', '); 
    168165                         } 
    169                          target.append(meta_link); 
     166                         pl.append(meta_link); 
    170167                    }); 
    171168                     
     
    177174                              return false; 
    178175                         }); 
    179                          target.append(', ').append(a_more); 
    180                     } 
     176                         pl.append(', ').append(a_more); 
     177                          
     178                         pl.addClass('hide'); 
     179                          
     180                         var pa = $('<p></p>'); 
     181                         target.append(pa); 
     182                          
     183                         var a = $('<a href="#" class="metaGetList">' + This.text_choose + '</a>'); 
     184                         a.click(function() { 
     185                              $('.addMeta').removeClass('hide'); 
     186                              $('.metaGetList').remove(); 
     187                              return false; 
     188                         }); 
     189                          
     190                         pa.append(a); 
     191                    } 
     192                     
     193                    target.append(pl); 
     194                     
    181195               } else { 
    182                     target.empty(); 
     196                    pl.empty(); 
    183197               } 
    184198          }); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map