* Dick Dral - Detora @ 2016
*/
/* Removes the class col-1, col-2 etc. from the div.
* This removes the fixed width from the div which gets its
* it's width from the content then
*/
function remove_col_x_class( div )
{
for ( i = 1; i <= 12 ; i++ )
{ $(div).removeClass('col-'+i); }
return div;
}
/* This function returns the label or input container of an Apex item.
* These divs can be used to put content on one line.
*/
function get_container_div ( colname, type )
{
type = ( type.toLowerCase() == 'label' ) ? 'label' : 'input';
var div = $('#'+colname.toUpperCase()+'_CONTAINER .t-Form-'+type+'Container');
return div;
}
function position_after ( itemName1, itemName2 )
{
input1 = remove_col_x_class( get_container_div(itemName1,'input') );
label2 = remove_col_x_class( get_container_div(itemName2,'label') );
input2 = remove_col_x_class( get_container_div(itemName2,'input') );
$(label2).insertAfter( $(input1) );
$(input2).insertAfter( $(label2) );
}
/////
position_after('P5_BD_QTY','P5_BD_UOM');
position_after('P5_BD_SIZE_QTY','P5_BD_SIZE_UOM');
position_after('P5_PKS_100ML','P5_PKS_100ML_UOM');
position_after('P5_NO_PKS_100ML','P5_NO_PKS_100ML_UOM');
position_after('P5_CON_SIZE','P5_CON_UOM');
position_after('P5_VALID_FRM','P5_REV_NO');
/////
#P5_BD_UOM_LABEL,#P5_BD_SIZE_UOM_LABEL,#P5_PKS_100ML_UOM_LABEL,#P5_NO_PKS_100ML_UOM_LABEL,#P5_CON_UOM_LABEL,#P5_REV_NO_LABEL {
margin-left: 10px;
margin-right: 10px;
}
No comments:
Post a Comment