OSDN Git Service

client is version0.4.34
authoritozyun <itozyun@gmail.com>
Sun, 20 May 2012 21:44:18 +0000 (06:44 +0900)
committeritozyun <itozyun@gmail.com>
Sun, 20 May 2012 21:44:18 +0000 (06:44 +0900)
0.4.x/javascripts/common.js

index 3a2e2ff..a604d02 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * pettanR common.js\r
- *   version 0.4.33\r
+ *   version 0.4.34\r
  * \r
  * author: itozyun\r
  */\r
@@ -1822,7 +1822,7 @@ pettanr.balloon = ( function() {
                })(),\r
                vectorEnabled = ELM_BALLOON_ORIGIN !== null &&\r
                                                pettanr.URL_PARAMS.vector !== false &&\r
-                                               !( IS_VML === true && pettanr.ua.VML === false )\r
+                                               !( IS_VML === true && pettanr.ua.VML === false );\r
 \r
        var cos        = Math.cos,\r
                sin        = Math.sin,\r
@@ -1846,16 +1846,7 @@ pettanr.balloon = ( function() {
                        instance = this,\r
                        l = ',';\r
                \r
-               function draw( _a, _w, _h ){\r
-                       a  = isFinit( _a ) === true ? _a : a;\r
-                       w  = isFinit( _w ) === true ? _w - PADDING_TOP * 2 : w;\r
-                       h  = isFinit( _h ) === true ? _h - PADDING_LEFT * 2 : h;\r
-\r
-                       if( vectorEnabled === false){\r
-                               balloonElm.setAttribute( 'src', pettanr.balloon.getBalloonUrl( w, h, _a ));\r
-                               return;\r
-                       }\r
-                       \r
+               function draw( _a ){\r
                        var rx      = w / 2,\r
                                ry      = h / 2,\r
                                tailRad = _a * DEG_TO_RAD,\r
@@ -1894,10 +1885,6 @@ pettanr.balloon = ( function() {
                        if( IS_VML === true ){\r
                                var _tailX = tailX *10,\r
                                        _tailY = tailY *10,\r
-                                       __startX = startX *10,\r
-                                       __startY = startY *10,\r
-                                       __endX = endX *10,\r
-                                       __endY = endY *10,\r
                                        __w = w *10,\r
                                        __h = h *10;\r
                                \r
@@ -1906,8 +1893,8 @@ pettanr.balloon = ( function() {
                                shape.coordsize = [ __w, __h ].join( l );\r
                                shape.path = [\r
                                        ' ar ', 0, l, 0, l, __w, l, __h, l,\r
-                                       round( __endX ), l, round( __endY ), l,\r
-                                       round( __startX ), l, round( __startY ),\r
+                                       round( endX * 10 ), l, round( endY * 10 ), l,\r
+                                       round( startX * 10 ), l, round( startY * 10 ),\r
                                        ' l ', round( _tailX ), l, round( _tailY ),\r
                                        ' x e'\r
                                ].join( '');\r
@@ -1927,14 +1914,28 @@ pettanr.balloon = ( function() {
                                ].join( ' '));\r
                        }\r
                }\r
-\r
-               draw( a, w, h );\r
                \r
                this.elm = balloonElm;\r
-               this.resize = draw;\r
+               this.resize = function ( _a, _w, _h ){\r
+                       w  = isFinit( _w ) === true ? _w - PADDING_TOP * 2 : w;\r
+                       h  = isFinit( _h ) === true ? _h - PADDING_LEFT * 2 : h;\r
+                       // ie6 でリサイズが反応しない対策\r
+                       if( vectorEnabled === false && pettanr.ua.isIE === true && pettanr.ua.ieVersion < 7 ){\r
+                               var parent = balloonElm.parentNode;\r
+                               parent.removeChild( balloonElm );\r
+                               parent.insertBefore( balloonElm, parent.firstChild );\r
+                       }\r
+                       instance.angle( _a );\r
+               };\r
                this.angle = function( _a ){\r
-                       _a !== undefined && _a !== a &&\r
-                               vectorEnabled === false ? pettanr.balloon.getBalloonUrl( w, h, _a ) : draw( _a );\r
+                       if( isFinit( _a ) === true ){\r
+                               a = _a;\r
+                               if( vectorEnabled === false ){\r
+                                       balloonElm.src = pettanr.balloon.getBalloonUrl( w, h, _a );\r
+                               } else {\r
+                                       draw( _a );\r
+                               }\r
+                       }\r
                        return a;\r
                }\r
                this.type = function( _type ){\r
@@ -1945,6 +1946,8 @@ pettanr.balloon = ( function() {
                        balloonElm.parentNode && balloonElm.parentNode.removeChild( balloonElm );\r
                        balloonElm = path = shape = instance = null;\r
                }\r
+               \r
+               instance.resize( a, w, h );\r
        };\r
        \r
        IS_VML === false && vectorEnabled === true && ( function(){\r
@@ -1968,6 +1971,7 @@ pettanr.balloon = ( function() {
                        return [\r
                                pettanr.CONST.SYSTEM_PICTURE_PATH, '_w',\r
                                _a < 360 - d / 2 ? floor( _a / d ) : 0,\r
+                               _w <= 400 || _h <= 400 ? '_b1' : '',\r
                                '.gif' ].join( '' );\r
            },\r
                TYPE_NONE:                              0,\r