Dotclear


Ignore:
Timestamp:
11/14/13 14:05:49 (12 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
2.6
Message:

meta-editor.js may now be instancied more than once, Fixes #1866

File:
1 edited

Legend:

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

    r2545 r2546  
    11//~ metaEditor & metaEditor.prototype should go to the core. 
    2 function metaEditor(target,meta_field,meta_type) { 
     2function metaEditor(target,meta_field,meta_type,meta_options) { 
    33     this.target = target; 
     4 
    45     this.meta_field = meta_field; 
    56     this.meta_type = meta_type; 
     7     this.meta_url = meta_options.meta_url || this.meta_url; 
     8     this.list_type = meta_options.list_type || this.list_type; 
     9     this.text_confirm_remove = meta_options.text_confirm_remove || this.text_confirm_remove; 
     10     this.text_add_meta = meta_options.text_add_meta || this.text_add_meta; 
     11     this.text_choose = meta_options.text_choose || this.text_choose; 
     12     this.text_all = meta_options.text_all || this.text_all; 
     13     this.text_separation = meta_options.text_separation || this.text_separation; 
    614}; 
    715 
     
    1321     text_all: 'all', 
    1422     text_separation: 'Separate each %s by comas', 
     23     list_type: 'more', 
    1524 
    1625     target: null, 
     
    124133          } 
    125134 
    126           this.showMetaList(metaEditor.prototype.meta_type,this.target); 
    127  
    128      }, 
    129  
    130      showMetaList: function(type,target) { 
     135          this.showMetaList(this.list_type,this.target); 
     136 
     137     }, 
     138 
     139     showMetaList: function(list_type,target) { 
    131140 
    132141          var params = { 
     
    136145          }; 
    137146 
    138           if (type == 'more') { 
     147          if (list_type == 'more') { 
    139148               params.limit = '30'; 
    140149          } 
     
    167176                    }); 
    168177 
    169                     if (type == 'more') { 
     178                    if (list_type == 'more') { 
    170179                         var a_more = $('<a href="#" class="metaGetMore"></a>'); 
    171180                         a_more.append(This.text_all + String.fromCharCode(160)+String.fromCharCode(187)); 
     
    177186                    } 
    178187 
    179                     if (type != 'more-all') { 
     188                    if (list_type != 'more-all') { 
    180189                         pl.addClass('hide'); 
    181190 
Note: See TracChangeset for help on using the changeset viewer.

Sites map