/*
* pettanR system.js
- * version 0.5.31
+ * version 0.5.32
*
* gadgetOS
* author:
var Overlay = ( function(){
var elmContainer, elmShadow, elmCloseButton,
+ bootParams,
application = null,
visible = false,
bodyOverflow = '',
function asyncInit( /* arguments */ ){
application.init();
//application.rootElement.style.display = 'none';
- };
- function asyncOpen( /* arguments */ ){
- var _arg = Util.copyArray( arguments );
- _arg.unshift( windowW, windowH );
- application.open.apply( application, _arg );
elmContainer.style.cssText = "top:" + body.scrollTop + 'px;display:none;';
$( elmContainer ).stop().fadeIn( onFadeInComplete );
};
+ function asyncOpen( /* arguments */ ){
+
+
+
+ };
function onFadeInComplete(){
KeyEvent.add( application, Const.KEY.EVENT.KEY_DOWN, Overlay.hide, 27 ); // 27.esc
MouseEvent.add( application, elmCloseButton, 'click', onCloseClick );
+
+ var _arg = bootParams; //Util.copyArray( arguments );
+ _arg.unshift( windowW, windowH );
+ application.open.apply( application, _arg );
};
function onFadeOutComplete(){
Util.removeAllChildren( elmContainer );
//asyncInit();
elmContainer.insertBefore( application.rootElement, elmCloseButton );
_application.addAsyncCall( asyncInit );
- _application.addAsyncCall( asyncOpen, _bootParams );
+ // _application.addAsyncCall( asyncOpen, );
+
+ bootParams = _bootParams;
},
hide: function(){
if( visible === false ) return;
var FileInputManager = ( function(){
var currentData,
elmForm,
+ elmFileInput,
elmWrap,
evt;
function asyncMouseout(){
currentData && currentData.item.blur();
};
-
+ function onClick(){
+ MouseEvent.remove( currentUser, elmFileInput, 'mouseout', asyncMouseout );
+ MouseEvent.remove( currentUser, elmFileInput, 'click', onClick );
+ };
return {
show : function( data ){
currentData = data;
-
- elmWrap = data.elmFileInputReal.parentNode;
+
+ elmFileInput = data.elmFileInputReal;
+ elmWrap = elmFileInput.parentNode;
//
updateWrapperPosition();
- data.elmFileInputReal.focus();
+ elmFileInput.focus();
//data.node.addEventListener( 'change', change, data );
- evt = new EventTicketClass( data.elmFileInputReal, 'change', change );
- // MouseEvent.add( currentUser, data.elmFileInputReal, 'mouseout', asyncMouseout );
- // MouseEvent.add( elmWrap, 'click', data.elmFileInputReal.focus, data.elmFileInputReal );
- currentData.elmFileInputReal.onchange = change;
+ evt = new EventTicketClass( elmFileInput, 'change', change );
+ MouseEvent.add( currentUser, elmFileInput, 'mouseout', asyncMouseout );
+ MouseEvent.add( currentUser, elmFileInput, 'click', onClick );
+ // currentData.elmFileInputReal.onchange = change;
SystemTimer.add( SUPER_USER_KEY, updateWrapperPosition, 500 );
},
hide : function( data ){
if( currentData !== data ) return;
// data.node.removeEventListener( 'change', change );
evt.destroy();
- MouseEvent.remove( currentUser, currentData.elmFileInputReal, 'mouseout', asyncMouseout );
- currentData.elmFileInputReal.onchange = null;
+ // MouseEvent.remove( currentUser, elmFileInput, 'mouseout', asyncMouseout );
+ onClick();
+ //currentData.elmFileInputReal.onchange = null;
elmWrap.style.display = 'none';
- currentData = null;
+ currentData = elmFileInput = null;
SystemTimer.remove( SUPER_USER_KEY, updateWrapperPosition );
},
onWindowResize: function( _w, _h ){
FormItemData.prototype = {
formData : null,
uiItem : null,
- init: function( formData, uiItem ){
+ init : function( formData, uiItem ){
this.formData = formData;
this.uiItem = uiItem;
+ },
+ onUpdate : function( v ){
+ // var index = Util.getIndex( this.formData.itemList, this );
}
};
case 'text':
break;
case 'file':
- el = Util.pullHtmlAsTemplete( '<div class="uiform-file-container"><div class="uiform-label"></div><div class="uiform-file fileinput-value"></div></div>' );
+ el = document.createElement( 'div' );
+ el.className = 'uiform-file-container';
+ el.appendChild( document.createElement( 'div' ) );
+ el.appendChild( document.createElement( 'div' ) );
+ el.firstChild.className = 'uiform-label';
+ el.lastChild.className = 'uiform-file fileinput-value';
+ // opera9 don't work for opera9;
+ //el = Util.pullHtmlAsTemplete( '<div class="uiform-file-container"><div class="uiform-label"></div><div class="uiform-file fileinput-value"></div></div>' );
elm.appendChild( el );
data = new FormItemData();
wrap = document.createElement( 'div' );
form.parentNode.insertBefore( wrap, form );
wrap.className = CLASSNAME_FILE_WRAP;
wrap.appendChild( form );
- data.init( this, this.ui.createFileInput( el, null, null, form ) );
+ data.init( this, this.ui.createFileInput( el, data.onUpdate, null, form ) );
this.itemList.push( data );
// alert( i )
break;