- Timestamp:
- 12/05/11 17:51:54 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ether_megapoli/trunk/web/resources/js/classesForJQuery/etherClasses.js
r259 r285 9 9 jQuery.each( jsonElements, jQuery.proxy( function( i, jsonElement ) 10 10 { 11 // if( jQuery.isArray( jsonElement ) && 1 < jsonElement.length )12 // var subItems = new ListItem( jsonElement, new Object() );13 // else14 11 this.addItem( jsonElement, objectParameter ); 15 12 }, this ) ); … … 123 120 }, 124 121 122 getNameWithCode: function () 123 { 124 if( jQuery.isArray( this.jsonElement ) ) 125 return this.jsonElement[0].name + " (" + this.jsonElement[0].code + ")"; 126 else 127 return this.jsonElement.name + " (" + this.jsonElement.code + ")"; 128 }, 129 125 130 getContentType: function() 126 131 { … … 135 140 this.divContainer.addClass( classNameValue ); 136 141 if( jQuery.isArray( this.jsonElement ) && 1 < this.jsonElement.length ) 137 this.divContainer.attr( {id:containerName + "_MENU _" + this.getId()} );142 this.divContainer.attr( {id:containerName + "_MENU"} ); 138 143 else 139 144 this.divContainer.attr( {id:containerName + "_" + this.getId()} ); … … 224 229 225 230 this.divHiddenElements = $( document.createElement( "div" ) ); 226 this.divHiddenElements.attr( { id:"divMenu_content" + this.getId(),class:"divMenu_content" } );231 this.divHiddenElements.attr( {class:"divMenu_content" } ); 227 232 228 233 jQuery.each( this.jsonElement, jQuery.proxy( function ( i, element ) … … 232 237 divSubMenu_name.addClass( "parameter_menu_" + element.id ); 233 238 divSubMenu_name.html( element.code ); 234 divSubMenu_name.bind( 'click', {divContainer:this.divContainer, jsonElement: element}, this.onClickMenu );239 divSubMenu_name.bind( 'click', {divContainer:this.divContainer, jsonElement:[element]}, this.onClickMenu ); 235 240 this.divHiddenElements.append( divSubMenu_name ); 236 241 }, this ) ); … … 248 253 $( "#divMenu_arrow_" + this.getId() ).removeClass( "deployed" ); 249 254 this.divHiddenElements.animate( {height:"toggle"}, 100 ); 250 }, this ) 251 ); 255 }, this ) ); 252 256 253 257 divMenu_arrow.toggle( … … 261 265 $( "#divMenu_arrow_" + this.getId() ).removeClass( "deployed" ); 262 266 this.divHiddenElements.animate( {width:"toggle"}, 100 ); 263 }, this ) 264 ); 267 }, this ) ); 265 268 } 266 269 else … … 270 273 onClickMenu: function( event ) 271 274 { 272 var jsonElement = event.data.jsonElement; 273 event.data = event.data.divContainer.item; 274 event.data.jsonElement = jsonElement; 275 event.data.divContainer.item.jsonElement = event.data.jsonElement; 275 276 } 276 277
Note: See TracChangeset
for help on using the changeset viewer.