Ignore:
Timestamp:
11/29/11 17:07:45 (13 years ago)
Author:
vmipsl
Message:

BO User

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ether_megapoli/trunk/web/resources/js/classesForJQuery/Button.js

    r240 r267  
    2424        this.callbackOnMouseOver = param.onMouseOver ? param.onMouseOver : false; 
    2525        this.callbackOnMouseOut = param.onMouseOut ? param.onMouseOut : false; 
     26        this.contextToSave = param.contextToSave ? param.contextToSave : false; 
    2627        this.boolDisabled = false; 
    2728        this.boolSelected = false; 
     
    4344 
    4445        // Define button events 
    45         this.divContainer.bind( 'click', this, this.onClick ); 
     46        if( this.contextToSave ) 
     47            this.divContainer.bind( 'click', [this, this.contextToSave], this.onClick ); 
     48        else 
     49            this.divContainer.bind( 'click', this, this.onClick ); 
    4650        this.divContainer.bind( 'mouseover', this, this.onHover ); 
    4751        this.divContainer.bind( 'mouseout', this, this.onOut ); 
     
    114118    { 
    115119        var contextButton = event.data; 
     120        var isContextToPut = false; 
     121        if( jQuery.isArray( event.data ) ) 
     122        { 
     123            isContextToPut = true; 
     124            contextButton = event.data[0]; 
     125        } 
     126 
    116127        if( !contextButton.isDisable() && (undefined == event.detail || 1 == event.detail) && contextButton.callbackOnClick ) 
    117             contextButton.callbackOnClick(); 
     128            if( isContextToPut ) 
     129                contextButton.callbackOnClick( event.data[1] ); 
     130            else 
     131                contextButton.callbackOnClick(); 
    118132    }, 
    119133 
Note: See TracChangeset for help on using the changeset viewer.