widgetresize.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  1. /**
  2. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. /* globals document, Event */
  6. import WidgetResize from '../src/widgetresize';
  7. // ClassicTestEditor can't be used, as it doesn't handle the focus, which is needed to test resizer visual cues.
  8. import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
  9. import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';
  10. import { toWidget } from '../src/utils';
  11. import { setData as setModelData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
  12. import { resizerMouseSimulator, focusEditor, getHandleCenterPoint, getWidgetDomParts } from './widgetresize/_utils/utils';
  13. describe( 'WidgetResize', () => {
  14. let editor, editorElement, widget, mouseListenerSpies, commitStub;
  15. const INITIAL_WIDGET_WIDTH = '25%';
  16. beforeEach( async () => {
  17. editorElement = createEditorElement();
  18. editor = await createEditor( editorElement );
  19. setModelData( editor.model, '[<widget></widget>]' );
  20. focusEditor( editor );
  21. widget = editor.editing.view.document.getRoot().getChild( 0 );
  22. // It's crucial to have a precisely defined editor size for this test suite.
  23. editor.editing.view.change( writer => {
  24. const viewEditableRoot = editor.editing.view.document.getRoot();
  25. writer.setAttribute( 'style', 'width: 400px; padding: 0px; overflow: hidden', viewEditableRoot );
  26. } );
  27. commitStub = sinon.stub();
  28. mouseListenerSpies = {
  29. down: sinon.spy( WidgetResize.prototype, '_mouseDownListener' ),
  30. move: sinon.spy( WidgetResize.prototype, '_mouseMoveListener' ),
  31. up: sinon.spy( WidgetResize.prototype, '_mouseUpListener' )
  32. };
  33. } );
  34. afterEach( () => {
  35. editorElement.remove();
  36. for ( const stub of Object.values( mouseListenerSpies ) ) {
  37. stub.restore();
  38. }
  39. if ( editor ) {
  40. return editor.destroy();
  41. }
  42. } );
  43. describe( 'plugin', () => {
  44. it( 'is loaded', () => {
  45. expect( editor.plugins.get( WidgetResize ) ).to.be.instanceOf( WidgetResize );
  46. } );
  47. } );
  48. describe( 'mouse listeners', () => {
  49. beforeEach( () => {
  50. createResizer();
  51. } );
  52. it( 'don\'t break when called with unexpected element', () => {
  53. const unrelatedElement = document.createElement( 'div' );
  54. editor.plugins.get( WidgetResize )._mouseDownListener( {}, {
  55. target: unrelatedElement
  56. } );
  57. } );
  58. it( 'passes new width to the options.onCommit()', () => {
  59. const usedResizer = 'top-right';
  60. const domParts = getWidgetDomParts( editor, widget, usedResizer );
  61. const initialPointerPosition = getHandleCenterPoint( domParts.widget, usedResizer );
  62. const finalPointerPosition = initialPointerPosition.clone().moveBy( 20, 0 );
  63. resizerMouseSimulator.dragTo( editor, domParts.resizeHandle, finalPointerPosition );
  64. expect( commitStub.callCount ).to.be.equal( 1 );
  65. sinon.assert.calledWithExactly( commitStub, '120px' );
  66. } );
  67. it( 'are detached when plugin is destroyed', async () => {
  68. await editor.destroy();
  69. const plugin = editor.plugins.get( WidgetResize );
  70. editor = null;
  71. const event = new Event( 'mousedown', { bubbles: true } );
  72. document.body.dispatchEvent( event );
  73. // Ensure nothing got called.
  74. expect( plugin._mouseDownListener.callCount ).to.be.equal( 0 );
  75. } );
  76. it( 'nothing bad happens if activeResizer got unset', () => {
  77. createResizer( {
  78. isCentered: () => true
  79. } );
  80. const usedResizer = 'top-right';
  81. const domParts = getWidgetDomParts( editor, widget, usedResizer );
  82. const initialPointerPosition = getHandleCenterPoint( domParts.widget, usedResizer );
  83. editor.plugins.get( WidgetResize )._getResizerByHandle = sinon.stub().returns( null );
  84. resizerMouseSimulator.dragTo( editor, domParts.resizeHandle, initialPointerPosition );
  85. // No exception should be thrown.
  86. } );
  87. } );
  88. describe( 'visibility', () => {
  89. beforeEach( () => {
  90. createResizer();
  91. } );
  92. it( 'it\'s hidden when no widget is focused', () => {
  93. // This particular test needs a paragraph, so that widget is no longer focused.
  94. setModelData( editor.model, '<widget></widget><paragraph>[]</paragraph>' );
  95. const allResizers = editor.ui.getEditableElement().querySelectorAll( '.ck-widget__resizer__handle' );
  96. for ( const resizer of allResizers ) {
  97. expect( isVisible( resizer ) ).to.be.false;
  98. }
  99. } );
  100. it( 'it\'s visible once the widget is focused', () => {
  101. // Widget is focused by default.
  102. const allResizers = editor.ui.getEditableElement().querySelectorAll( '.ck-widget__resizer__handle' );
  103. for ( const resizer of allResizers ) {
  104. expect( isVisible( resizer ) ).to.be.true;
  105. }
  106. } );
  107. function isVisible( element ) {
  108. // Checks if the DOM element is visible to the end user.
  109. return element.offsetParent !== null && !element.classList.contains( 'ck-hidden' );
  110. }
  111. } );
  112. describe( 'integration (pixels)', () => {
  113. describe( 'aligned widget', () => {
  114. beforeEach( () => {
  115. createResizer();
  116. } );
  117. it( 'properly sets the state for subsequent resizes', () => {
  118. const usedResizer = 'top-right';
  119. const domParts = getWidgetDomParts( editor, widget, usedResizer );
  120. const initialPointerPosition = getHandleCenterPoint( domParts.widget, usedResizer );
  121. const intermediatePointerPosition = initialPointerPosition.clone().moveBy( 50, 0 );
  122. resizerMouseSimulator.dragTo( editor, domParts.resizeHandle, intermediatePointerPosition );
  123. sinon.assert.calledWithExactly( commitStub.firstCall, '150px' );
  124. const finalPointerPosition = intermediatePointerPosition.clone().moveBy( 50, 0 );
  125. resizerMouseSimulator.dragTo( editor, domParts.resizeHandle, finalPointerPosition );
  126. sinon.assert.calledWithExactly( commitStub.secondCall, '200px' );
  127. expect( commitStub.callCount ).to.be.equal( 2 );
  128. } );
  129. it( 'shrinks correctly with left-bottom handler', generateResizeTest( {
  130. usedHandle: 'bottom-left',
  131. movePointerBy: { x: 20, y: -10 },
  132. expectedWidth: '80px'
  133. } ) );
  134. it( 'shrinks correctly with right-bottom handler', generateResizeTest( {
  135. usedHandle: 'bottom-right',
  136. movePointerBy: { x: -20, y: -10 },
  137. expectedWidth: '80px'
  138. } ) );
  139. it( 'shrinks correctly with left-top handler', generateResizeTest( {
  140. usedHandle: 'top-left',
  141. movePointerBy: { x: 20, y: 10 },
  142. expectedWidth: '80px'
  143. } ) );
  144. it( 'shrinks correctly with right-top handler', generateResizeTest( {
  145. usedHandle: 'top-right',
  146. movePointerBy: { x: -20, y: 10 },
  147. expectedWidth: '80px'
  148. } ) );
  149. it( 'enlarges correctly with left-bottom handler', generateResizeTest( {
  150. usedHandle: 'bottom-left',
  151. movePointerBy: { x: -10, y: 10 },
  152. expectedWidth: '120px'
  153. } ) );
  154. it( 'enlarges correctly with right-bottom handler', generateResizeTest( {
  155. usedHandle: 'bottom-right',
  156. movePointerBy: { x: 10, y: 10 },
  157. expectedWidth: '120px'
  158. } ) );
  159. it( 'enlarges correctly with right-bottom handler, y axis only', generateResizeTest( {
  160. usedHandle: 'bottom-right',
  161. movePointerBy: { x: 0, y: 20 },
  162. expectedWidth: '140px'
  163. } ) );
  164. it( 'enlarges correctly with right-bottom handler, x axis only', generateResizeTest( {
  165. usedHandle: 'bottom-right',
  166. movePointerBy: { x: 40, y: 0 },
  167. expectedWidth: '140px'
  168. } ) );
  169. it( 'enlarges correctly with left-top handler', generateResizeTest( {
  170. usedHandle: 'top-left',
  171. movePointerBy: { x: -20, y: -10 },
  172. expectedWidth: '120px'
  173. } ) );
  174. it( 'enlarges correctly with right-top handler', generateResizeTest( {
  175. usedHandle: 'top-right',
  176. movePointerBy: { x: 20, y: 10 },
  177. expectedWidth: '120px'
  178. } ) );
  179. } );
  180. describe( 'centered widget', () => {
  181. beforeEach( () => {
  182. createResizer( {
  183. isCentered: () => true
  184. } );
  185. } );
  186. it( 'shrinks correctly with left-bottom handler', generateResizeTest( {
  187. usedHandle: 'bottom-left',
  188. movePointerBy: { x: 10, y: -10 },
  189. expectedWidth: '80px'
  190. } ) );
  191. it( 'shrinks correctly with right-bottom handler', generateResizeTest( {
  192. usedHandle: 'bottom-right',
  193. movePointerBy: { x: -10, y: -10 },
  194. expectedWidth: '80px'
  195. } ) );
  196. it( 'enlarges correctly with right-bottom handler, x axis only', generateResizeTest( {
  197. usedHandle: 'bottom-right',
  198. movePointerBy: { x: 10, y: 0 },
  199. expectedWidth: '120px'
  200. } ) );
  201. it( 'enlarges correctly with right-bottom handler, y axis only', generateResizeTest( {
  202. usedHandle: 'bottom-right',
  203. movePointerBy: { x: 0, y: 10 },
  204. expectedWidth: '120px'
  205. } ) );
  206. it( 'enlarges correctly with left-bottom handler, x axis only', generateResizeTest( {
  207. usedHandle: 'bottom-left',
  208. movePointerBy: { x: -10, y: 0 },
  209. expectedWidth: '120px'
  210. } ) );
  211. it( 'enlarges correctly with left-bottom handler, y axis only', generateResizeTest( {
  212. usedHandle: 'bottom-left',
  213. movePointerBy: { x: 0, y: 10 },
  214. expectedWidth: '120px'
  215. } ) );
  216. // --- top handlers ---
  217. it( 'enlarges correctly with left-top handler', generateResizeTest( {
  218. usedHandle: 'top-left',
  219. movePointerBy: { x: -10, y: -10 },
  220. expectedWidth: '120px'
  221. } ) );
  222. it( 'enlarges correctly with left-top handler, y axis only', generateResizeTest( {
  223. usedHandle: 'top-left',
  224. movePointerBy: { x: 0, y: -10 },
  225. expectedWidth: '120px'
  226. } ) );
  227. it( 'enlarges correctly with right-top handler', generateResizeTest( {
  228. usedHandle: 'top-right',
  229. movePointerBy: { x: 10, y: -10 },
  230. expectedWidth: '120px'
  231. } ) );
  232. it( 'enlarges correctly with right-top handler, y axis only', generateResizeTest( {
  233. usedHandle: 'top-right',
  234. movePointerBy: { x: 0, y: -10 },
  235. expectedWidth: '120px'
  236. } ) );
  237. } );
  238. } );
  239. describe( 'integration (percents)', () => {
  240. describe( 'side aligned widget', () => {
  241. beforeEach( () => {
  242. createResizer( {
  243. unit: undefined
  244. } );
  245. } );
  246. it( 'properly sets the state for subsequent resizes', () => {
  247. const usedResizer = 'top-right';
  248. const domParts = getWidgetDomParts( editor, widget, usedResizer );
  249. const initialPointerPosition = getHandleCenterPoint( domParts.widget, usedResizer );
  250. const intermediatePointerPosition = initialPointerPosition.clone().moveBy( 100, 0 );
  251. resizerMouseSimulator.dragTo( editor, domParts.resizeHandle, intermediatePointerPosition );
  252. sinon.assert.calledWithExactly( commitStub.firstCall, '50%' );
  253. const finalPointerPosition = intermediatePointerPosition.clone().moveBy( 100, 0 );
  254. resizerMouseSimulator.dragTo( editor, domParts.resizeHandle, finalPointerPosition );
  255. sinon.assert.calledWithExactly( commitStub.secondCall, '75%' );
  256. expect( commitStub.callCount ).to.be.equal( 2 );
  257. } );
  258. it( 'shrinks correctly with bottom-left handler', generateResizeTest( {
  259. usedHandle: 'bottom-left',
  260. movePointerBy: { x: 10, y: -10 },
  261. expectedWidth: '22.5%'
  262. } ) );
  263. } );
  264. describe( 'centered widget', () => {
  265. beforeEach( () => {
  266. createResizer( {
  267. isCentered: () => true,
  268. unit: undefined
  269. } );
  270. } );
  271. it( 'shrinks correctly with bottom-left handler', generateResizeTest( {
  272. usedHandle: 'bottom-left',
  273. movePointerBy: { x: 10, y: -10 },
  274. expectedWidth: '20%'
  275. } ) );
  276. it( 'enlarges correctly with bottom-right handler', generateResizeTest( {
  277. usedHandle: 'bottom-right',
  278. movePointerBy: { x: 0, y: 5 },
  279. expectedWidth: '27.5%'
  280. } ) );
  281. it( 'enlarges correctly an image with unsupported width unit', () => {
  282. editor.editing.view.change( writer => {
  283. writer.setStyle( 'width', '100pt', widget );
  284. } );
  285. generateResizeTest( {
  286. usedHandle: 'bottom-right',
  287. movePointerBy: { x: 0, y: 5 },
  288. expectedWidth: '36.67%'
  289. } )();
  290. } );
  291. } );
  292. it( 'doesn\'t call options.onCommit() in case of no change', () => {
  293. const commitStub = sinon.stub();
  294. createResizer( {
  295. onCommit: commitStub
  296. } );
  297. const domParts = getWidgetDomParts( editor, widget, 'top-left' );
  298. resizerMouseSimulator.down( editor, domParts.resizeHandle );
  299. resizerMouseSimulator.up( editor );
  300. expect( commitStub.callCount, 'call count' ).to.be.eql( 0 );
  301. } );
  302. it( 'restores the original view width after resize is done', () => {
  303. // Note that ultimately width should be changed, but through a model converter, not with direct view changes (#6060).
  304. createResizer();
  305. const renderListener = sinon.stub();
  306. const usedHandle = 'bottom-right';
  307. const domParts = getWidgetDomParts( editor, widget, usedHandle );
  308. const finalPointerPosition = getHandleCenterPoint( domParts.widget, usedHandle ).moveBy( 40, 40 );
  309. editor.editing.view.on( 'render', renderListener );
  310. resizerMouseSimulator.dragTo( editor, domParts.resizeHandle, finalPointerPosition );
  311. expect( widget.getStyle( 'width' ) ).to.equal( INITIAL_WIDGET_WIDTH );
  312. // Verify render count https://github.com/ckeditor/ckeditor5-widget/pull/122#issuecomment-617012777.
  313. expect( renderListener.callCount ).to.be.equal( 3 );
  314. } );
  315. it( 'returns proper value when resize host is different from widget wrapper', () => {
  316. createResizer( {
  317. unit: undefined,
  318. getHandleHost( domWidgetElement ) {
  319. return domWidgetElement.querySelector( '.sub-div' );
  320. }
  321. } );
  322. const usedHandle = 'bottom-right';
  323. const pointerDifference = { x: -10, y: -10 };
  324. const expectedWidth = '20%';
  325. const domParts = getWidgetDomParts( editor, widget, usedHandle );
  326. const resizeHost = domParts.widget.querySelector( '.sub-div' );
  327. const initialPointerPosition = getHandleCenterPoint( resizeHost, usedHandle );
  328. const finalPointerPosition = initialPointerPosition.moveBy( pointerDifference.x, pointerDifference.y );
  329. resizerMouseSimulator.dragTo( editor, domParts.resizeHandle, finalPointerPosition );
  330. expect( commitStub.callCount, 'call count' ).to.be.eql( 1 );
  331. expect( commitStub.args[ 0 ][ 0 ], 'width' ).to.be.equal( expectedWidth );
  332. sinon.assert.calledOnce( commitStub );
  333. } );
  334. it( 'doesn\'t break if the widget wrapper was removed from DOM', () => {
  335. const resizer = createResizer( {
  336. unit: undefined
  337. } );
  338. const domParts = getWidgetDomParts( editor, widget, 'bottom-right' );
  339. domParts.resizeWrapper.remove();
  340. resizer.redraw();
  341. } );
  342. } );
  343. describe( 'attachTo()', () => {
  344. it( 'works without WidgetToolbarRepository plugin', async () => {
  345. const localEditorElement = createEditorElement();
  346. const localEditor = await ClassicEditor.create( localEditorElement, {
  347. plugins: [
  348. WidgetResize, simpleWidgetPlugin
  349. ]
  350. } );
  351. setModelData( localEditor.model, '[<widget></widget>]' );
  352. const resizerOptions = {
  353. modelElement: localEditor.model.document.getRoot().getChild( 0 ),
  354. viewElement: localEditor.editing.view.document.getRoot().getChild( 0 ),
  355. editor: localEditor,
  356. isCentered: () => false,
  357. getHandleHost( domWidgetElement ) {
  358. return domWidgetElement;
  359. },
  360. getResizeHost( domWidgetElement ) {
  361. return domWidgetElement;
  362. },
  363. onCommit: commitStub
  364. };
  365. localEditor.plugins.get( WidgetResize ).attachTo( resizerOptions );
  366. // Nothing should be thrown.
  367. // And clean up.
  368. localEditorElement.remove();
  369. return localEditor.destroy();
  370. } );
  371. } );
  372. describe( 'init()', () => {
  373. it( 'adds listener to redraw resizer on visible resizer change', async () => {
  374. setModelData( editor.model, '<widget></widget><paragraph>[]</paragraph>' );
  375. widget = editor.editing.view.document.getRoot().getChild( 0 );
  376. const resizer = createResizer();
  377. const redrawSpy = sinon.spy( resizer, 'redraw' );
  378. focusEditor( editor );
  379. editor.model.change( writer => {
  380. const widgetModel = editor.model.document.getRoot().getChild( 0 );
  381. writer.setSelection( widgetModel, 'on' );
  382. } );
  383. expect( redrawSpy.callCount ).to.be.equal( 1 );
  384. } );
  385. } );
  386. describe( 'cancel()', () => {
  387. it( 'restores original view width', () => {
  388. const resizer = createResizer();
  389. const usedHandle = 'bottom-right';
  390. const domParts = getWidgetDomParts( editor, widget, usedHandle );
  391. const startingPosition = getHandleCenterPoint( domParts.widget, usedHandle ).moveBy( 100, 0 );
  392. const domTarget = domParts.resizeHandle;
  393. resizerMouseSimulator.down( editor, domTarget );
  394. resizerMouseSimulator.move( editor, domTarget, {
  395. pageX: startingPosition.x,
  396. pageY: startingPosition.y
  397. } );
  398. resizer.cancel();
  399. // Value should be restored to the initial value (#6060).
  400. expect( widget.getStyle( 'width' ) ).to.be.equal( INITIAL_WIDGET_WIDTH );
  401. } );
  402. } );
  403. describe( '_getResizerByHandle()', () => {
  404. it( 'returns properly in case of invalid handle element', () => {
  405. const randomElement = document.createElement( 'span' );
  406. const plugin = editor.plugins.get( WidgetResize );
  407. createResizer();
  408. expect( plugin._getResizerByHandle( randomElement ) ).to.be.undefined;
  409. } );
  410. } );
  411. /**
  412. * @param {Object} options
  413. * @param {String} options.usedHandle Handle that should be used for resize, e.g. 'bottom-right'.
  414. * @param {Object} options.movePointerBy How much should the pointer move during the drag compared to the initial position.
  415. * @param {String} options.expectedWidth
  416. */
  417. function generateResizeTest( options ) {
  418. return () => {
  419. options = options || {};
  420. const usedHandle = options.usedHandle;
  421. const domParts = getWidgetDomParts( editor, widget, usedHandle );
  422. const initialPointerPosition = getHandleCenterPoint( domParts.widget, usedHandle );
  423. const pointerDifference = options.movePointerBy;
  424. const finalPointerPosition = initialPointerPosition.moveBy( pointerDifference.x, pointerDifference.y );
  425. resizerMouseSimulator.dragTo( editor, domParts.resizeHandle, finalPointerPosition );
  426. expect( commitStub.callCount, 'call count' ).to.be.eql( 1 );
  427. expect( commitStub.args[ 0 ][ 0 ], 'width' ).to.be.equal( options.expectedWidth );
  428. sinon.assert.calledOnce( commitStub );
  429. };
  430. }
  431. function createEditor( element ) {
  432. return ClassicEditor
  433. .create( element, {
  434. plugins: [
  435. ArticlePluginSet, WidgetResize, simpleWidgetPlugin
  436. ]
  437. } );
  438. }
  439. function simpleWidgetPlugin( editor ) {
  440. editor.model.schema.register( 'widget', {
  441. inheritAllFrom: '$block',
  442. isObject: true
  443. } );
  444. editor.conversion.for( 'downcast' )
  445. .elementToElement( {
  446. model: 'widget',
  447. view: ( modelItem, viewWriter ) => {
  448. const parentDiv = viewWriter.createContainerElement( 'div' );
  449. viewWriter.setStyle( 'height', '50px', parentDiv );
  450. viewWriter.setStyle( 'width', '25%', parentDiv ); // It evaluates to 100px.
  451. const subDiv = viewWriter.createContainerElement( 'div' );
  452. viewWriter.insert( viewWriter.createPositionAt( subDiv, 'start' ), viewWriter.createText( 'foo' ) );
  453. viewWriter.addClass( 'sub-div', subDiv );
  454. viewWriter.setStyle( 'height', '20px', subDiv );
  455. viewWriter.setStyle( 'width', '50px', subDiv );
  456. viewWriter.insert( viewWriter.createPositionAt( parentDiv, 'start' ), subDiv );
  457. return toWidget( parentDiv, viewWriter, {
  458. label: 'element label'
  459. } );
  460. }
  461. } );
  462. }
  463. function createEditorElement() {
  464. const element = document.createElement( 'div' );
  465. document.body.appendChild( element );
  466. return element;
  467. }
  468. function createResizer( resizerOptions ) {
  469. const widgetModel = editor.model.document.getRoot().getChild( 0 );
  470. const defaultOptions = {
  471. unit: 'px',
  472. modelElement: widgetModel,
  473. viewElement: widget,
  474. editor,
  475. isCentered: () => false,
  476. getHandleHost( domWidgetElement ) {
  477. return domWidgetElement;
  478. },
  479. getResizeHost( domWidgetElement ) {
  480. return domWidgetElement;
  481. },
  482. onCommit: commitStub
  483. };
  484. return editor.plugins.get( WidgetResize ).attachTo( Object.assign( defaultOptions, resizerOptions ) );
  485. }
  486. } );