| | 966 | // Resize helper. |
| | 967 | |
| | 968 | editor.on( 'init', function() { |
| | 969 | var ghostObject, resizeHelper; |
| | 970 | |
| | 971 | editor.on( 'ObjectResizeStart', function( event ) { |
| | 972 | resizeHelper = editor.dom.create( 'DIV', { 'class': 'mce-resize-helper' }, event.width + ' × ' + event.height ); |
| | 973 | ghostObject = editor.dom.select( '.mce-clonedresizable' )[0]; |
| | 974 | editor.getBody().appendChild( resizeHelper ); |
| | 975 | editor.on( 'mousemove', resizing ); |
| | 976 | } ); |
| | 977 | |
| | 978 | editor.on( 'ObjectResized', function() { |
| | 979 | editor.off( 'mousemove', resizing ); |
| | 980 | editor.dom.remove( resizeHelper ); |
| | 981 | } ); |
| | 982 | |
| | 983 | function resizing( event ) { |
| | 984 | editor.dom.setStyles( resizeHelper, { 'top': event.clientY, 'left': event.clientX } ); |
| | 985 | editor.dom.setHTML( resizeHelper, ghostObject.width + ' × ' + ghostObject.height ); |
| | 986 | } |
| | 987 | } ); |
| | 988 | |