Ignore:
Timestamp:
Jun 24, 2012, 9:18:26 PM (12 years ago)
Author:
grum
Message:

feature:2634- compatibility with Piwigo 2.4
+add some objects on js framework

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/GrumPluginClasses/js/ui.inputSwitchButton.js

    r12215 r16012  
    11/**
    22 * -----------------------------------------------------------------------------
    3  * file: ui.inputCheckbox.js
    4  * file version: 1.0.0
    5  * date: 2011-06-18
     3 * file: ui.inputSwitchButton.js
     4 * file version: 1.0.1
     5 * date: 2012-06-18
    66 *
    77 * A jQuery plugin provided by the piwigo's plugin "GrumPluginClasses"
     
    1111 *   email    : grum@piwigo.com
    1212 *   website  : http://photos.grum.fr
    13  *   PWG user : http://forum.phpwebgallery.net/profile.php?id=3706
    1413 *
    1514 *   << May the Little SpaceFrog be with you ! >>
     
    2423 * | 1.0.0   | 2011/06/18 | first release
    2524 * |         |            |
    26  * |         |            |
     25 * | 1.0.1   | 2012/06/18 | * improve memory managment
    2726 * |         |            |
    2827 * |         |            |
     
    5352                  properties = $this.data('properties'),
    5453                  options =
    55                     {                     
     54                    {
    5655                      values:
    5756                        {
     
    9998            {
    10099              // default values for the plugin
    101               var properties=this.data('properties');
    102               $this.unbind('.inputSwitchButton');
    103               this.removeClass('ui-inputSwitchButton');
     100              var $this=$(this);
     101
     102              $this
     103                .unbind('.inputSwitchButton')
     104                .removeData()
     105                .removeClass('ui-inputSwitchButton ui-inputSwitchButton-unchecked ui-inputSwitchButton-checked');
     106              delete $this;
    104107            }
    105108          );
     
    136139          }
    137140        }, // disabled
    138        
     141
    139142      values: function (values)
    140143        {
     
    191194          {
    192195            var options = this.data('options');
    193            
     196
    194197            return(properties.checked?options.values.checked:options.values.unchecked);
    195198          }
     
    283286          return(options.values);
    284287        }, //setValues
    285        
    286        
     288
     289
    287290      setGroup: function (object, value)
    288291        {
     
    298301              if(listGroup==null) listGroup=[];
    299302              p=$.inArray(object.attr('id'), listGroup);
    300               if(p>-1) listGroup.splice(p,1);             
     303              if(p>-1) listGroup.splice(p,1);
    301304              $(document).data('isbGroup_'+options.group, listGroup);
    302             }           
     305            }
    303306            options.group=value;
    304307            listGroup=$(document).data('isbGroup_'+value);
     
    307310            $(document).data('isbGroup_'+value, listGroup);
    308311          }
    309         },       
    310        
     312        },
     313
    311314      switchValue: function (object)
    312315        {
     
    340343              }
    341344            }
    342            
     345
    343346            object
    344347              .addClass('ui-inputSwitchButton-checked')
Note: See TracChangeset for help on using the changeset viewer.