Changeset 64986 in vbox for trunk/src/VBox/ValidationKit/testmanager/htdocs/js/common.js
- Timestamp:
- Dec 21, 2016 2:36:33 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/htdocs/js/common.js
r61217 r64986 352 352 } 353 353 354 355 /** @name Collapsable / Expandable items 356 * @{ 357 */ 358 359 360 /** 361 * Toggles the collapsable / expandable state of a parent DD and DT unclke. 362 * 363 * @returns true 364 * @param oAnchor The anchor object. 365 */ 366 function toggleCollapsableDtDd(oAnchor) 367 { 368 var oParent = oAnchor.parentElement; 369 var sClass = oParent.className; 370 var oUncle = oParent.nextSibling; 371 var sNewClass; 372 var sNewChar; 373 374 /* Determin the new class and arrow char. */ 375 if (sClass.endsWith('collapsable')) 376 { 377 sNewClass = sClass.substr(0, sClass.length - 11) + 'expandable'; 378 sNewChar = '\u25B6'; /* black right-pointing triangle */ 379 } 380 else if (sClass.endsWith('expandable')) 381 { 382 sNewClass = sClass.substr(0, sClass.length - 10) + 'collapsable'; 383 sNewChar = '\u25BC'; /* black down-pointing triangle */ 384 } 385 else 386 { 387 console.log('toggleCollapsableParent: Invalid class: ' + sClass); 388 return true; 389 } 390 391 /* Update the parent (DT) class and anchor text. */ 392 oParent.className = sNewClass; 393 oAnchor.firstChild.textContent = sNewChar + oAnchor.firstChild.textContent.substr(1); 394 395 /* Update the uncle (DD) class.*/ 396 if (oUncle) 397 oUncle.className = sNewClass; 398 return true; 399 } 400 401 /** @} */ 354 402 355 403
Note:
See TracChangeset
for help on using the changeset viewer.