From 97cebed40489b9bebb94d6a1a2b7901185b7bc69 Mon Sep 17 00:00:00 2001 From: itozyun Date: Mon, 23 Apr 2012 05:47:55 +0900 Subject: [PATCH] client is version0.4.25, fixed petanr.form on windowResize. --- public/assets/common.js | 85 ++++++++++++++++++++++++++++--------------------- 1 file changed, 48 insertions(+), 37 deletions(-) diff --git a/public/assets/common.js b/public/assets/common.js index 0007b340..2b151660 100644 --- a/public/assets/common.js +++ b/public/assets/common.js @@ -1020,6 +1020,7 @@ pettanr.view = ( function(){ h = jqWindow.height(); currentApplication && currentApplication.resize( w, h ); pettanr.overlay.onWindowResize( w, h ); + pettanr.form.onWindowResize( w, h ); } return { @@ -1083,7 +1084,7 @@ pettanr.overlay = ( function(){ windowW, windowH; function asyncResize(){ - currentOverlay.resize( windowW, windowH); + currentOverlay.resize( windowW, windowH ); } function onCloseClick( e){ pettanr.overlay.hide(); @@ -1312,6 +1313,7 @@ pettanr.form = ( function(){ currentID = null, currentItem = null, CLASSNAME_COMBOBOX_OPTION = 'combobox-option', + windowW, windowH, ELM_A_ORIGIN = ( function(){ var ret = document.createElement( 'a'); ret.href = '#'; @@ -1335,7 +1337,7 @@ pettanr.form = ( function(){ elmToggle.appendChild( document.createTextNode( '▼' )); elmValue.appendChild( document.createTextNode( 'null' )); return ret; - })() + })(); var InputTextClass = function( WRAPPER_ELM, ON_UPDATE_FUNCTION, GROUP_ID, validater ){ validater = Type.isFunction( validater ) === true ? validater : null; @@ -1654,6 +1656,15 @@ pettanr.form = ( function(){ currentCombobox.blur(); OptionControl.hide( currentCombobox ); } + function updateWrapperPosition(){ + var position = pettanr.util.getAbsolutePosition( elm ); + + ELM_OPTION_WRAPPER.style.cssText = [ + 'width:', elm.offsetWidth - 2, 'px;', + 'left:', position.x, 'px;', + 'top:', position.y + elm.offsetHeight, 'px;' + ].join(''); + } return { show: function( _combobox, _optionList ){ if( currentItem !== _combobox || currentCombobox === _combobox ) return; @@ -1665,23 +1676,15 @@ pettanr.form = ( function(){ updateCurrrentOption( _combobox.value(), false ); - var position = pettanr.util.getAbsolutePosition( elm ), - _option; - for( var i=0, l=optionList.length; i