wire/modules/AdminTheme/AdminThemeUikit/scripts/main.js
// $in: An optional Inputfield that you want to populate given or auto-determined classes to
$in: An optional Inputfield that you want to populate given or auto-determined classes to
$in : An optional Inputfield that you want to populate given or auto - determined classes to
function ukGridClass(width, $in) {
			if(noGrid && typeof $in != "undefined") {
				if(typeof width == "string") {
					$in.addClass(width);
				} else {
					$in.css('width', width + '%');
				}
				return '';
			}
			var ukGridClassDefault = 'uk-width-1-1';
			var ukGridClass = ukGridClassDefault;
			var widthIsClass = false;
			if(typeof width == "string" && typeof $in != "undefined") {
				ukGridClass = width;
				widthIsClass = true;
			} else if(!width || width >= 100) {
				ukGridClass = ukGridClassDefault;
			} else if(typeof ukGridClassCache[width] != "undefined") {
				ukGridClass = 'uk-width-' + ukGridClassCache[width];
			} else {
				for(var pct in ProcessWire.config.ukGridWidths) {
					var cn = ProcessWire.config.ukGridWidths[pct];
					pct = parseInt(pct);
					if(width >= pct) {
						ukGridClass = cn;
						break;
					}
				}
				if(ukGridClass.length) {
					ukGridClassCache[width] = ukGridClass;
					ukGridClass = 'uk-width-' + ukGridClass;
				}
			}
			if(!widthIsClass && ukGridClass && ukGridClass != ukGridClassDefault) {
				ukGridClass += '@m';
			}
			if(typeof $in != "undefined") {
				if(ukGridClass && $in.hasClass(ukGridClass)) {
				} else {
					removeUkGridClass($in);
					if(ukGridClass) $in.addClass(ukGridClass);
				}
			}
			return ukGridClass;
		}
function ukGridClass ( width , $in ) { if ( noGrid && typeof $in != "undefined" ) { if ( typeof width == "string" ) { $in . addClass ( width ) ; } else { $in . css ( 'width' , width + '%' ) ; } return '' ; } var ukGridClassDefault = 'uk-width-1-1' ; var ukGridClass = ukGridClassDefault ; var widthIsClass = false ; if ( typeof width == "string" && typeof $in != "undefined" ) { ukGridClass = width ; widthIsClass = true ; } else if ( ! width || width >= 100 ) { ukGridClass = ukGridClassDefault ; } else if ( typeof ukGridClassCache [ width ] != "undefined" ) { ukGridClass = 'uk-width-' + ukGridClassCache [ width ] ; } else { for ( var pct in ProcessWire . config . ukGridWidths ) { var cn = ProcessWire . config . ukGridWidths [ pct ] ; pct = parseInt ( pct ) ; if ( width >= pct ) { ukGridClass = cn ; break ; } } if ( ukGridClass . length ) { ukGridClassCache [ width ] = ukGridClass ; ukGridClass = 'uk-width-' + ukGridClass ; } } if ( ! widthIsClass && ukGridClass && ukGridClass != ukGridClassDefault ) { ukGridClass += '@m' ; } if ( typeof $in != "undefined" ) { if ( ukGridClass && $in . hasClass ( ukGridClass ) ) { } else { removeUkGridClass ( $in ) ; if ( ukGridClass ) $in . addClass ( ukGridClass ) ; } } return ukGridClass ; }
$in: An optional Inputfield that you want to populate given or auto-determined classes to
$in : An optional Inputfield that you want to populate given or auto - determined classes to
// class already specified in width argument // full width // use previously cached value // determine width from predefined setting // no need to do anything