summaryrefslogtreecommitdiffstats
path: root/media/forms/cmxform.js
diff options
context:
space:
mode:
Diffstat (limited to 'media/forms/cmxform.js')
-rw-r--r--media/forms/cmxform.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/media/forms/cmxform.js b/media/forms/cmxform.js
new file mode 100644
index 0000000..0b7973d
--- /dev/null
+++ b/media/forms/cmxform.js
@@ -0,0 +1,22 @@
+if( document.addEventListener ) document.addEventListener( 'DOMContentLoaded', cmxform, false );
+
+function cmxform(){
+ // Hide forms
+ $( 'form.cmxform' ).hide().end();
+
+ // Processing
+ $( 'form.cmxform' ).find( 'li/label' ).not( '.nocmx' ).each( function( i ){
+ var labelContent = this.innerHTML;
+ var labelWidth = document.defaultView.getComputedStyle( this, '' ).getPropertyValue( 'width' );
+ var labelSpan = document.createElement( 'span' );
+ labelSpan.style.display = 'block';
+ labelSpan.style.width = labelWidth;
+ labelSpan.innerHTML = labelContent;
+ this.style.display = '-moz-inline-box';
+ this.innerHTML = null;
+ this.appendChild( labelSpan );
+ } ).end();
+
+ // Show forms
+ $( 'form.cmxform' ).show().end();
+} \ No newline at end of file