Changeset 8007
- Timestamp:
- 02/28/2014 09:46:51 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-members/admin/js/admin.js
r7963 r8007 32 32 33 33 34 function clear(container) { 35 if( !document.getElementById(container) ) return; 34 /** 35 * Deselects any select options or input options for the specified field element. 36 * 37 * @param {String} container HTML ID of the field 38 * @since BuddyPress (1.0.0) 39 */ 40 function clear( container ) { 41 container = document.getElementById( container ); 42 if ( ! container ) { 43 return; 44 } 36 45 37 var container = document.getElementById(container); 46 var radioButtons = container.getElementsByTagName( 'INPUT' ), 47 options = container.getElementsByTagName( 'OPTION' ), 48 i = 0; 38 49 39 if ( radioButtons = container.getElementsByTagName('INPUT')) {40 for (var i=0; i<radioButtons.length; i++) {50 if ( radioButtons ) { 51 for ( i = 0; i < radioButtons.length; i++ ) { 41 52 radioButtons[i].checked = ''; 42 53 } 43 54 } 44 55 45 if ( options = container.getElementsByTagName('OPTION')) {46 for (var i=0; i<options.length; i++) {56 if ( options ) { 57 for ( i = 0; i < options.length; i++ ) { 47 58 options[i].selected = false; 48 59 } 49 60 } 50 51 return;52 61 } -
trunk/bp-templates/bp-legacy/js/buddypress.js
r7952 r8007 1697 1697 } 1698 1698 1699 function clear(container) { 1700 if( !document.getElementById(container) ) return; 1701 1702 var container = document.getElementById(container); 1703 1704 if ( radioButtons = container.getElementsByTagName('INPUT') ) { 1705 for(var i=0; i<radioButtons.length; i++) { 1699 /** 1700 * Deselects any select options or input options for the specified field element. 1701 * 1702 * @param {String} container HTML ID of the field 1703 * @since BuddyPress (1.2.0) 1704 */ 1705 function clear( container ) { 1706 container = document.getElementById( container ); 1707 if ( ! container ) { 1708 return; 1709 } 1710 1711 var radioButtons = container.getElementsByTagName( 'INPUT' ), 1712 options = container.getElementsByTagName( 'OPTION' ), 1713 i = 0; 1714 1715 if ( radioButtons ) { 1716 for ( i = 0; i < radioButtons.length; i++ ) { 1706 1717 radioButtons[i].checked = ''; 1707 1718 } 1708 1719 } 1709 1720 1710 if ( options = container.getElementsByTagName('OPTION')) {1711 for (var i=0; i<options.length; i++) {1721 if ( options ) { 1722 for ( i = 0; i < options.length; i++ ) { 1712 1723 options[i].selected = false; 1713 1724 } 1714 1725 } 1715 1716 return;1717 1726 } 1718 1727
Note: See TracChangeset
for help on using the changeset viewer.