1 //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
2 //>>description: Styling to responsively position forms and labels based on screen width and add visual separation
3 //>>label: Fieldcontainers
5 //>>css.structure: ../css/structure/jquery.mobile.forms.fieldcontain.css
6 //>>css.theme: ../css/themes/default/jquery.mobile.theme.css
8 define( [ "jquery" ], function( $ ) {
9 //>>excludeEnd("jqmBuildExclude");
10 (function( $, undefined ) {
12 // filter function removes whitespace between label and form element so we can use inline-block (nodeType 3 = text)
13 $.fn.fieldcontain = function( options ) {
15 .addClass( "ui-field-contain ui-body ui-br" )
16 .contents().filter( function() {
17 return ( this.nodeType === 3 && !/\S/.test( this.nodeValue ) );
21 //auto self-init widgets
22 $( document ).bind( "pagecreate create", function( e ) {
23 $( ":jqmData(role='fieldcontain')", e.target ).jqmEnhanceable().fieldcontain();
27 //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
29 //>>excludeEnd("jqmBuildExclude");