Changeset 767 for tapas/web/resources/js/classesForJQuery
- Timestamp:
- 04/25/13 12:22:14 (11 years ago)
- Location:
- tapas/web/resources/js/classesForJQuery
- Files:
-
- 2 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
tapas/web/resources/js/classesForJQuery/LoginButton.js
r490 r767 228 228 { 229 229 this.errors = jQuery.parseJSON( result ).errors; 230 this.setJSONUser( null != jQuery.parseJSO N( result ).jSONUser ? jQuery.parseJSON( result ).jSONUser : false );230 this.setJSONUser( null != jQuery.parseJSOetherN( result ).jSONUser ? jQuery.parseJSON( result ).jSONUser : false ); 231 231 if( null == this.errors ) 232 232 this.updateLoginOrLogout(); -
tapas/web/resources/js/classesForJQuery/Select.js
r502 r767 39 39 this.isHover = false; 40 40 this.arrayOptions = $(); 41 this.values = $();42 41 this.className = objectParameter.className ? "select_container " + objectParameter.className : "select_container"; 43 42 this.classNameOption = objectParameter.classNameOption ? "select_choicelist " + objectParameter.classNameOption : "select_choicelist"; 43 // this.callbackSelect = objectParameter.callbackSelect ? objectParameter.callbackSelect : false; 44 45 // Variables 46 this.itemValues = $(); 44 47 45 48 // Select div 46 49 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} ); 48 51 49 52 this.divSelectLeft = $( document.createElement( "div" ) ) … … 65 68 this.divOption.addClass( this.classNameOption ); 66 69 this.parent.append( this.divOption ); 70 71 //rajout pour onclick 72 // if(this.callbackSelect) 73 // this.divSelect.bind( 'click', this, this.onClickSelect ); 67 74 68 75 this.divSelect.bind( "mouseup", this, this.toggleOption ); … … 71 78 this.divOption.bind( 'mouseover', this, this.onMouseHover ); 72 79 this.divOption.bind( 'mouseout', this, this.onMouseOut ); 80 this.parent.bind( 'mouseleave', this, this.onMouseParentOut ); 73 81 74 82 if( this.isDisplayed ) … … 89 97 }, 90 98 99 getValue2: function() 100 { 101 return this.itemValue2; 102 }, 103 91 104 getValues: function() 92 105 { 93 return this. values;106 return this.itemValues; 94 107 }, 95 108 96 109 getValuesInString: function( separator ) 97 110 { 98 var valulues = $.makeArray( this. values );111 var valulues = $.makeArray( this.itemValues ); 99 112 if( separator ) 100 113 return valulues.join( separator ); … … 148 161 this.divSelect.addClass( "disable" ); 149 162 this.hideOption(); 163 /* Nath*/ 164 this.divSelectMiddle.removeClass( "select_selectMiddle" ); 165 this.divSelectMiddle.addClass( "select_selectMiddle_disable" ); 150 166 }, 151 167 … … 155 171 this.isDisable = false; 156 172 this.divSelect.removeClass( "disable" ); 173 /* Nath*/ 174 this.divSelectMiddle.removeClass( "select_selectMiddle_disable" ); 175 this.divSelectMiddle.addClass( "select_selectMiddle" ); 157 176 }, 158 177 … … 176 195 177 196 // public 178 add: function( itemValue, itemName, callback )197 add: function( itemValue, itemName, callback, itemValue2 ) 179 198 { 180 199 var divOptionMiddle = $( document.createElement( "div" ) ); … … 183 202 divOptionMiddle.itemName = itemName; 184 203 divOptionMiddle.itemValue = itemValue; 204 if( itemValue2 ) 205 divOptionMiddle.itemValue2 = itemValue2; 185 206 divOptionMiddle.callback = callback; 186 207 this.divOption.append( divOptionMiddle ); … … 189 210 190 211 this.arrayOptions.push( divOptionMiddle ); 191 this. values.push( itemValue );212 this.itemValues.push( itemValue ); 192 213 }, 193 214 … … 202 223 var index = jQuery.inArray( divOption, this.arrayOptions ); 203 224 this.arrayOptions.splice( index, 1 ); 204 this. values.splice( index, 1 );225 this.itemValues.splice( index, 1 ); 205 226 return false; 206 227 } … … 213 234 this.divOption.empty(); 214 235 this.arrayOptions = $(); 215 this. values = $();236 this.itemValues = $(); 216 237 }, 217 238 … … 265 286 this.itemName = divOption.itemName; 266 287 this.itemValue = divOption.itemValue; 288 this.itemValue2 = divOption.itemValue2; 267 289 this.divSelectMiddle.html( this.itemName ); 268 290 }, … … 276 298 contextEvent.hideOption(); 277 299 contextEvent.select( divOption.itemValue, true ); 278 if( undefined != divOption.callback )279 divOption.callback( divOption.itemValue );280 300 }, 281 301 … … 287 307 288 308 // private 309 onMouseParentOut: function( event ) 310 { 311 event.data.isHover = false; 312 event.data.hideOption(); 313 }, 314 289 315 onMouseOut: function( event ) 290 316 { … … 307 333 } 308 334 } 335 336 // onClickSelect: function() 337 // { 338 // this.callbackSelect(); 339 // } 309 340 } );
Note: See TracChangeset
for help on using the changeset viewer.