/*\r
* pettanR work.js\r
- * version 0.4.25\r
+ * version 0.4.26\r
* \r
* author:\r
* itozyun\r
if( Type.isArray( _argBack ) === true ){ // isArray\r
while( _argBack.length > 0){\r
_value = _argBack.shift();\r
- _destroy === true && typeof _value.destroy === 'function' && _value.destroy();\r
+ _destroy === true && Type.isFunction( _value.destroy ) === true && _value.destroy();\r
}\r
}\r
if( Type.isArray( _argForword ) === true ){\r
while( _argForword.length > 0){\r
_value = _argForword.shift();\r
- _destroy === true && typeof _value.destroy === 'function' && _value.destroy();\r
+ _destroy === true && Type.isFunction( _value.destroy ) === true && _value.destroy();\r
} \r
} \r
}\r
MENUBAR_BACK.visible( false);\r
MENUBAR_FORWARD.visible( false);\r
while( STACK_BACK.length > 0){\r
- destroyStack( STACK_BACK.shift(), true);\r
+ destroyStack( STACK_BACK.shift(), true );\r
}\r
while( STACK_FORWARD.length > 0){\r
- destroyStack( STACK_FORWARD.shift(), true);\r
+ destroyStack( STACK_FORWARD.shift(), true );\r
}\r
},\r
saveState: function( _function, _argBack, _argForword, _destroy) {\r
var _stack;\r
while( STACK_FORWARD.length > 0){\r
_stack = STACK_FORWARD.shift();\r
- destroyStack( _stack, _stack.destroy);\r
+ destroyStack( _stack, _stack.destroy );\r
}\r
MENUBAR_FORWARD.visible( false);\r
} \r
jqImageElementOrigin = jqImageElementOrigin || $( $( '#imgElementTemplete').remove().html());\r
\r
var JQ_WRAPPER = jqImageElementOrigin.clone( true ),\r
- SAVE = HISTORY_CONTROL.saveState,\r
- HIT_AREA = MOUSE_HIT_AREA,\r
w = data.width,\r
h = data.height,\r
x, y, z,\r
h = Math.floor( h );\r
\r
function onAnimeComplete(){\r
- reversibleImage.resize( flipH * w, flipV * h );\r
+ reversibleImage && reversibleImage.resize( flipH * w, flipV * h );\r
}\r
function updateResourcePicture( _resourcePicture ){\r
resourcePicture = _resourcePicture;\r
}\r
this.resourcePicture = function( _resourcePicture ){\r
if( _resourcePicture && _resourcePicture !== resourcePicture ){\r
- SAVE( updateResourcePicture, resourcePicture, _resourcePicture );\r
+ HISTORY_CONTROL.saveState( updateResourcePicture, resourcePicture, _resourcePicture );\r
updateResourcePicture( _resourcePicture );\r
}\r
return resourcePicture;\r
this.animate = function ( _x, _y, _w, _h, _flipH, _flipV ){\r
flipH = _flipH !== undefined ? _flipH : flipH;\r
flipV = _flipV !== undefined ? _flipV : flipV;\r
- instance.resize( _x, _y, _w, _h, true);\r
+ instance.resize( _x, _y, _w, _h, true );\r
}\r
this.destroy = function(){\r
+ delete instance.destroy;\r
+ \r
reversibleImage.destroy();\r
- JQ_WRAPPER.remove();\r
- JQ_WRAPPER = reversibleImage = resourcePicture = data = instance = SAVE = null;\r
- delete this.destroy;\r
+ JQ_WRAPPER.stop().remove();\r
+ JQ_WRAPPER = reversibleImage = resourcePicture = data = instance = null;\r
}\r
}\r
ImageElementClass.prototype = new AbstractComicElement( PANEL_ELEMENT_TYPE_IMAGE );\r
\r
var JQ_WRAPPER = jqTextElementOrigin.clone( true ),\r
TEXT_ELM = JQ_WRAPPER.find( 'td,.speach-inner').eq( 0),\r
- HIT_AREA = MOUSE_HIT_AREA,\r
- SAVE = HISTORY_CONTROL.saveState,\r
type = data.balloon_template_id,\r
text = ( function(){\r
var _speachs = data.speaches_attributes;\r
x, y, w, h, a,\r
instance = this;\r
\r
- JQ_WRAPPER.find( 'img').eq( 0).replaceWith( balloon.elm );\r
+ JQ_WRAPPER.find( 'img' ).eq( 0 ).replaceWith( balloon.elm );\r
\r
function updateType( _type ){\r
if( type !== _type ){\r
text = _text || text || '';\r
TEXT_ELM.html( text );\r
}\r
+ function resizeBalloon(){\r
+ balloon && balloon.resize( a, w, h );\r
+ }\r
\r
/* global methods */\r
this.$ = JQ_WRAPPER;\r
delete instance.init;\r
}\r
this.angle = function( _a ){\r
- _a !== undefined && instance.resize( undefined, undefined, undefined, undefined, _a);\r
+ _a !== undefined && instance.resize( undefined, undefined, undefined, undefined, _a );\r
return a;\r
}\r
this.text = function( _text){\r
if( _text && text !== _text) {\r
- SAVE( updateText, text || '', _text);\r
+ HISTORY_CONTROL.saveState( updateText, text || '', _text );\r
updateText( _text);\r
}\r
return text;\r
top: y,\r
width: w,\r
height: h\r
- }, 250,\r
- function(){\r
- balloon.resize( a, w, h);\r
- }\r
+ }, 250, resizeBalloon\r
); \r
- animate !== true && balloon.resize( a, w, h);\r
+ animate !== true && resizeBalloon();\r
}\r
this.animate = function ( _x, _y, _w, _h, _a ){\r
instance.resize( _x, _y, _w, _h, _a, true);\r
}\r
this.destroy = function(){\r
- JQ_WRAPPER.remove();\r
- balloon.destroy();\r
- balloon = null;\r
delete instance.destroy;\r
+ \r
+ JQ_WRAPPER.stop().remove();\r
+ balloon.destroy();\r
+ JQ_WRAPPER = TEXT_ELM = data = balloon = instance = null;\r
}\r
}\r
TextElementClass.prototype = new AbstractComicElement( PANEL_ELEMENT_TYPE_TEXT );\r