Plugin Directory

Changeset 559659


Ignore:
Timestamp:
06/18/2012 04:13:14 AM (14 years ago)
Author:
technosis
Message:

Adding handles for instance where there is no template select box (only one template, default)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • templ33t/branches/01_02_handling_posts/templ33t.js

    r556483 r559659  
    3636
    3737        //alert(TL33T_def.toString());
    38 
    39         // save current template index
    40         ctemp = jQuery('select#page_template').prop('selectedIndex');
     38       
     39        if(jQuery('select#page_template').length > 0) {
     40
     41            // save current template index
     42            ctemp = jQuery('select#page_template').prop('selectedIndex');
     43           
     44            // add event listener to template select
     45            jQuery('select#page_template').change(templ33t_switchTemplate);
     46
     47        }
    4148       
    4249        //alert(getUserSetting('editor')+' = '+(!getUserSetting('editor')));
     
    4552        ctmode = (getUserSetting('editor') == 'tinymce' || !getUserSetting('editor') ? false : true);
    4653       
    47         // add event listener to template select
    48         jQuery('select#page_template').change(templ33t_switchTemplate);
    49 
    5054        // set up templ33t
    5155        if(jQuery('div#templ33t_control').length) {
     
    171175    var fromcustom = (jQuery('#postdivrich').css('display') == 'none');
    172176    var tocustom;
    173     var tslg = jQuery('select#page_template').val() == 'default' ? TL33T_current.default_template : jQuery('select#page_template').val();
     177    var tslg = jQuery('select#page_template').length == 0 || jQuery('select#page_template').val() == 'default' ? TL33T_current.default_template : jQuery('select#page_template').val();
    174178    if(nobj.parent().index() > 0)
    175179        tocustom = TL33T_def[tslg].blocks[(nobj.parent().index() - 1)].custom;
     
    262266                } else {
    263267                   
    264                     var tslg = jQuery('select#page_template').val() == 'default' ? TL33T_current.default_template : jQuery('select#page_template').val();
     268                    var tslg = jQuery('select#page_template').length == 0 || jQuery('select#page_template').val() == 'default' ? TL33T_current.default_template : jQuery('select#page_template').val();
    265269                   
    266270                    if(!TL33T_def[tslg].blocks[(jQuery(this).index() - 1)].custom) {
Note: See TracChangeset for help on using the changeset viewer.