Ignore:
Timestamp:
04/25/13 12:22:14 (11 years ago)
Author:
rboipsl
Message:

V2 ajout infobulles + textes

Location:
tapas/web/resources/js/classesForJQuery
Files:
2 edited
1 copied

Legend:

Unmodified
Added
Removed
  • tapas/web/resources/js/classesForJQuery/LoginButton.js

    r490 r767  
    228228    { 
    229229        this.errors = jQuery.parseJSON( result ).errors; 
    230         this.setJSONUser( null != jQuery.parseJSON( result ).jSONUser ? jQuery.parseJSON( result ).jSONUser : false ); 
     230        this.setJSONUser( null != jQuery.parseJSOetherN( result ).jSONUser ? jQuery.parseJSON( result ).jSONUser : false ); 
    231231        if( null == this.errors ) 
    232232            this.updateLoginOrLogout(); 
  • tapas/web/resources/js/classesForJQuery/Select.js

    r502 r767  
    3939        this.isHover = false; 
    4040        this.arrayOptions = $(); 
    41         this.values = $(); 
    4241        this.className = objectParameter.className ? "select_container " + objectParameter.className : "select_container"; 
    4342        this.classNameOption = objectParameter.classNameOption ? "select_choicelist " + objectParameter.classNameOption : "select_choicelist"; 
     43//                this.callbackSelect = objectParameter.callbackSelect ? objectParameter.callbackSelect : false; 
     44 
     45        // Variables 
     46        this.itemValues = $(); 
    4447 
    4548        // Select div 
    4649        this.divSelect = $( document.createElement( "div" ) ); 
    47         this.divSelect.attr( {id:this.id, class:this.className } ); 
     50        this.divSelect.attr( {id:this.id, class:this.className} ); 
    4851 
    4952        this.divSelectLeft = $( document.createElement( "div" ) ) 
     
    6568        this.divOption.addClass( this.classNameOption ); 
    6669        this.parent.append( this.divOption ); 
     70 
     71        //rajout pour onclick 
     72//                if(this.callbackSelect) 
     73//                    this.divSelect.bind( 'click', this, this.onClickSelect ); 
    6774 
    6875        this.divSelect.bind( "mouseup", this, this.toggleOption ); 
     
    7178        this.divOption.bind( 'mouseover', this, this.onMouseHover ); 
    7279        this.divOption.bind( 'mouseout', this, this.onMouseOut ); 
     80        this.parent.bind( 'mouseleave', this, this.onMouseParentOut ); 
    7381 
    7482        if( this.isDisplayed ) 
     
    8997    }, 
    9098 
     99    getValue2: function() 
     100    { 
     101        return this.itemValue2; 
     102    }, 
     103 
    91104    getValues: function() 
    92105    { 
    93         return this.values; 
     106        return this.itemValues; 
    94107    }, 
    95108 
    96109    getValuesInString: function( separator ) 
    97110    { 
    98         var valulues = $.makeArray( this.values ); 
     111        var valulues = $.makeArray( this.itemValues ); 
    99112        if( separator ) 
    100113            return valulues.join( separator ); 
     
    148161        this.divSelect.addClass( "disable" ); 
    149162        this.hideOption(); 
     163        /* Nath*/ 
     164        this.divSelectMiddle.removeClass( "select_selectMiddle" ); 
     165        this.divSelectMiddle.addClass( "select_selectMiddle_disable" ); 
    150166    }, 
    151167 
     
    155171        this.isDisable = false; 
    156172        this.divSelect.removeClass( "disable" ); 
     173        /* Nath*/ 
     174        this.divSelectMiddle.removeClass( "select_selectMiddle_disable" ); 
     175        this.divSelectMiddle.addClass( "select_selectMiddle" ); 
    157176    }, 
    158177 
     
    176195 
    177196    // public 
    178     add: function( itemValue, itemName, callback ) 
     197    add: function( itemValue, itemName, callback, itemValue2 ) 
    179198    { 
    180199        var divOptionMiddle = $( document.createElement( "div" ) ); 
     
    183202        divOptionMiddle.itemName = itemName; 
    184203        divOptionMiddle.itemValue = itemValue; 
     204        if( itemValue2 ) 
     205            divOptionMiddle.itemValue2 = itemValue2; 
    185206        divOptionMiddle.callback = callback; 
    186207        this.divOption.append( divOptionMiddle ); 
     
    189210 
    190211        this.arrayOptions.push( divOptionMiddle ); 
    191         this.values.push( itemValue ); 
     212        this.itemValues.push( itemValue ); 
    192213    }, 
    193214 
     
    202223                var index = jQuery.inArray( divOption, this.arrayOptions ); 
    203224                this.arrayOptions.splice( index, 1 ); 
    204                 this.values.splice( index, 1 ); 
     225                this.itemValues.splice( index, 1 ); 
    205226                return false; 
    206227            } 
     
    213234        this.divOption.empty(); 
    214235        this.arrayOptions = $(); 
    215         this.values = $(); 
     236        this.itemValues = $(); 
    216237    }, 
    217238 
     
    265286        this.itemName = divOption.itemName; 
    266287        this.itemValue = divOption.itemValue; 
     288        this.itemValue2 = divOption.itemValue2; 
    267289        this.divSelectMiddle.html( this.itemName ); 
    268290    }, 
     
    276298        contextEvent.hideOption(); 
    277299        contextEvent.select( divOption.itemValue, true ); 
    278         if( undefined != divOption.callback ) 
    279             divOption.callback( divOption.itemValue ); 
    280300    }, 
    281301 
     
    287307 
    288308    // private 
     309    onMouseParentOut: function( event ) 
     310    { 
     311        event.data.isHover = false; 
     312        event.data.hideOption(); 
     313    }, 
     314 
    289315    onMouseOut: function( event ) 
    290316    { 
     
    307333        } 
    308334    } 
     335 
     336//            onClickSelect: function() 
     337//            { 
     338//                this.callbackSelect(); 
     339//            } 
    309340} ); 
Note: See TracChangeset for help on using the changeset viewer.