ui.overlay.js 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242
  1. /**
  2. * DevExtreme (ui/overlay/ui.overlay.js)
  3. * Version: 19.1.16
  4. * Build date: Tue Oct 18 2022
  5. *
  6. * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
  7. * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
  8. */
  9. "use strict";
  10. function _typeof(obj) {
  11. "@babel/helpers - typeof";
  12. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  13. return typeof obj
  14. } : function(obj) {
  15. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
  16. }, _typeof(obj)
  17. }
  18. var $ = require("../../core/renderer");
  19. var domAdapter = require("../../core/dom_adapter");
  20. var windowUtils = require("../../core/utils/window");
  21. var ready = require("../../core/utils/ready_callbacks").add;
  22. var window = windowUtils.getWindow();
  23. var navigator = windowUtils.getNavigator();
  24. var eventsEngine = require("../../events/core/events_engine");
  25. var fx = require("../../animation/fx");
  26. var translator = require("../../animation/translator");
  27. var compareVersions = require("../../core/utils/version").compare;
  28. var viewPortUtils = require("../../core/utils/view_port");
  29. var extend = require("../../core/utils/extend").extend;
  30. var inArray = require("../../core/utils/array").inArray;
  31. var getPublicElement = require("../../core/utils/dom").getPublicElement;
  32. var viewPortChanged = viewPortUtils.changeCallback;
  33. var hideTopOverlayCallback = require("../../mobile/hide_top_overlay").hideCallback;
  34. var positionUtils = require("../../animation/position");
  35. var fitIntoRange = require("../../core/utils/math").fitIntoRange;
  36. var domUtils = require("../../core/utils/dom");
  37. var noop = require("../../core/utils/common").noop;
  38. var typeUtils = require("../../core/utils/type");
  39. var each = require("../../core/utils/iterator").each;
  40. var devices = require("../../core/devices");
  41. var browser = require("../../core/utils/browser");
  42. var registerComponent = require("../../core/component_registrator");
  43. var Widget = require("../widget/ui.widget");
  44. var KeyboardProcessor = require("../widget/ui.keyboard_processor");
  45. var selectors = require("../widget/selectors");
  46. var dragEvents = require("../../events/drag");
  47. var eventUtils = require("../../events/utils");
  48. var pointerEvents = require("../../events/pointer");
  49. var Resizable = require("../resizable");
  50. var EmptyTemplate = require("../widget/empty_template");
  51. var Deferred = require("../../core/utils/deferred").Deferred;
  52. var zIndexPool = require("./z_index");
  53. var swatch = require("../widget/swatch_container");
  54. var OVERLAY_CLASS = "dx-overlay";
  55. var OVERLAY_WRAPPER_CLASS = "dx-overlay-wrapper";
  56. var OVERLAY_CONTENT_CLASS = "dx-overlay-content";
  57. var OVERLAY_SHADER_CLASS = "dx-overlay-shader";
  58. var OVERLAY_MODAL_CLASS = "dx-overlay-modal";
  59. var INNER_OVERLAY_CLASS = "dx-inner-overlay";
  60. var INVISIBLE_STATE_CLASS = "dx-state-invisible";
  61. var ANONYMOUS_TEMPLATE_NAME = "content";
  62. var RTL_DIRECTION_CLASS = "dx-rtl";
  63. var ACTIONS = ["onShowing", "onShown", "onHiding", "onHidden", "onPositioning", "onPositioned", "onResizeStart", "onResize", "onResizeEnd"];
  64. var OVERLAY_STACK = [];
  65. var DISABLED_STATE_CLASS = "dx-state-disabled";
  66. var PREVENT_SAFARI_SCROLLING_CLASS = "dx-prevent-safari-scrolling";
  67. var TAB_KEY = "tab";
  68. var POSITION_ALIASES = {
  69. top: {
  70. my: "top center",
  71. at: "top center"
  72. },
  73. bottom: {
  74. my: "bottom center",
  75. at: "bottom center"
  76. },
  77. right: {
  78. my: "right center",
  79. at: "right center"
  80. },
  81. left: {
  82. my: "left center",
  83. at: "left center"
  84. },
  85. center: {
  86. my: "center",
  87. at: "center"
  88. },
  89. "right bottom": {
  90. my: "right bottom",
  91. at: "right bottom"
  92. },
  93. "right top": {
  94. my: "right top",
  95. at: "right top"
  96. },
  97. "left bottom": {
  98. my: "left bottom",
  99. at: "left bottom"
  100. },
  101. "left top": {
  102. my: "left top",
  103. at: "left top"
  104. }
  105. };
  106. var realDevice = devices.real();
  107. var realVersion = realDevice.version;
  108. var firefoxDesktop = browser.mozilla && "desktop" === realDevice.deviceType;
  109. var iOS = "ios" === realDevice.platform;
  110. var hasSafariAddressBar = browser.safari && "desktop" !== realDevice.deviceType;
  111. var iOS7_0andBelow = iOS && compareVersions(realVersion, [7, 1]) < 0;
  112. var android4_0nativeBrowser = "android" === realDevice.platform && 0 === compareVersions(realVersion, [4, 0], 2) && navigator.userAgent.indexOf("Chrome") === -1;
  113. var forceRepaint = function($element) {
  114. if (iOS7_0andBelow || firefoxDesktop) {
  115. $element.width()
  116. }
  117. if (android4_0nativeBrowser) {
  118. var $parents = $element.parents();
  119. var inScrollView = $parents.is(".dx-scrollable-native");
  120. if (!inScrollView) {
  121. $parents.css("backfaceVisibility", "hidden");
  122. $parents.css("backfaceVisibility");
  123. $parents.css("backfaceVisibility", "visible")
  124. }
  125. }
  126. };
  127. var getElement = function(value) {
  128. return value && $(value.target || value)
  129. };
  130. ready(function() {
  131. eventsEngine.subscribeGlobal(domAdapter.getDocument(), pointerEvents.down, function(e) {
  132. for (var i = OVERLAY_STACK.length - 1; i >= 0; i--) {
  133. if (!OVERLAY_STACK[i]._proxiedDocumentDownHandler(e)) {
  134. return
  135. }
  136. }
  137. })
  138. });
  139. var Overlay = Widget.inherit({
  140. _supportedKeys: function() {
  141. var offsetSize = 5;
  142. var move = function(top, left, e) {
  143. if (!this.option("dragEnabled")) {
  144. return
  145. }
  146. e.preventDefault();
  147. e.stopPropagation();
  148. var allowedOffsets = this._allowedOffsets();
  149. var offset = {
  150. top: fitIntoRange(top, -allowedOffsets.top, allowedOffsets.bottom),
  151. left: fitIntoRange(left, -allowedOffsets.left, allowedOffsets.right)
  152. };
  153. this._changePosition(offset)
  154. };
  155. return extend(this.callBase(), {
  156. escape: function() {
  157. this.hide()
  158. },
  159. upArrow: move.bind(this, -offsetSize, 0),
  160. downArrow: move.bind(this, offsetSize, 0),
  161. leftArrow: move.bind(this, 0, -offsetSize),
  162. rightArrow: move.bind(this, 0, offsetSize)
  163. })
  164. },
  165. _getDefaultOptions: function() {
  166. return extend(this.callBase(), {
  167. activeStateEnabled: false,
  168. visible: false,
  169. deferRendering: true,
  170. shading: true,
  171. shadingColor: "",
  172. position: {
  173. my: "center",
  174. at: "center"
  175. },
  176. width: function() {
  177. return .8 * $(window).width()
  178. },
  179. minWidth: null,
  180. maxWidth: null,
  181. height: function() {
  182. return .8 * $(window).height()
  183. },
  184. minHeight: null,
  185. maxHeight: null,
  186. animation: {
  187. show: {
  188. type: "pop",
  189. duration: 300,
  190. from: {
  191. scale: .55
  192. }
  193. },
  194. hide: {
  195. type: "pop",
  196. duration: 300,
  197. to: {
  198. opacity: 0,
  199. scale: .55
  200. },
  201. from: {
  202. opacity: 1,
  203. scale: 1
  204. }
  205. }
  206. },
  207. closeOnOutsideClick: false,
  208. closeOnBackButton: true,
  209. onShowing: null,
  210. onShown: null,
  211. onHiding: null,
  212. onHidden: null,
  213. contentTemplate: "content",
  214. dragEnabled: false,
  215. resizeEnabled: false,
  216. onResizeStart: null,
  217. onResize: null,
  218. onResizeEnd: null,
  219. innerOverlay: false,
  220. target: void 0,
  221. container: void 0,
  222. hideTopOverlayHandler: void 0,
  223. closeOnTargetScroll: false,
  224. onPositioned: null,
  225. boundaryOffset: {
  226. h: 0,
  227. v: 0
  228. },
  229. propagateOutsideClick: false,
  230. ignoreChildEvents: true,
  231. _checkParentVisibility: true
  232. })
  233. },
  234. _defaultOptionsRules: function() {
  235. return this.callBase().concat([{
  236. device: function() {
  237. var realDevice = devices.real();
  238. var realPlatform = realDevice.platform;
  239. var realVersion = realDevice.version;
  240. return "android" === realPlatform && compareVersions(realVersion, [4, 2]) < 0
  241. },
  242. options: {
  243. animation: {
  244. show: {
  245. type: "fade",
  246. duration: 400
  247. },
  248. hide: {
  249. type: "fade",
  250. duration: 400,
  251. to: {
  252. opacity: 0
  253. },
  254. from: {
  255. opacity: 1
  256. }
  257. }
  258. }
  259. }
  260. }, {
  261. device: function() {
  262. return !windowUtils.hasWindow()
  263. },
  264. options: {
  265. width: null,
  266. height: null,
  267. animation: null,
  268. _checkParentVisibility: false
  269. }
  270. }])
  271. },
  272. _setOptionsByReference: function() {
  273. this.callBase();
  274. extend(this._optionsByReference, {
  275. animation: true
  276. })
  277. },
  278. _getAnonymousTemplateName: function() {
  279. return ANONYMOUS_TEMPLATE_NAME
  280. },
  281. _wrapper: function() {
  282. return this._$wrapper
  283. },
  284. _container: function() {
  285. return this._$content
  286. },
  287. _eventBindingTarget: function() {
  288. return this._$content
  289. },
  290. _init: function() {
  291. this.callBase();
  292. this._initActions();
  293. this._initCloseOnOutsideClickHandler();
  294. this._initTabTerminatorHandler();
  295. this._$wrapper = $("<div>").addClass(OVERLAY_WRAPPER_CLASS);
  296. this._$content = $("<div>").addClass(OVERLAY_CONTENT_CLASS);
  297. this._initInnerOverlayClass();
  298. var $element = this.$element();
  299. this._$wrapper.addClass($element.attr("class"));
  300. $element.addClass(OVERLAY_CLASS);
  301. this._$wrapper.attr("data-bind", "dxControlsDescendantBindings: true");
  302. eventsEngine.on(this._$wrapper, "MSPointerDown", noop);
  303. eventsEngine.on(this._$wrapper, "focusin", function(e) {
  304. e.stopPropagation()
  305. });
  306. this._toggleViewPortSubscription(true)
  307. },
  308. _initOptions: function(options) {
  309. this._initTarget(options.target);
  310. var container = void 0 === options.container ? this.option("container") : options.container;
  311. this._initContainer(container);
  312. this._initHideTopOverlayHandler(options.hideTopOverlayHandler);
  313. this.callBase(options)
  314. },
  315. _initInnerOverlayClass: function() {
  316. this._$content.toggleClass(INNER_OVERLAY_CLASS, this.option("innerOverlay"))
  317. },
  318. _initTarget: function(target) {
  319. if (!typeUtils.isDefined(target)) {
  320. return
  321. }
  322. var options = this.option();
  323. each(["position.of", "animation.show.from.position.of", "animation.show.to.position.of", "animation.hide.from.position.of", "animation.hide.to.position.of"], function(_, path) {
  324. var pathParts = path.split(".");
  325. var option = options;
  326. while (option) {
  327. if (1 === pathParts.length) {
  328. if (typeUtils.isPlainObject(option)) {
  329. option[pathParts.shift()] = target
  330. }
  331. break
  332. } else {
  333. option = option[pathParts.shift()]
  334. }
  335. }
  336. })
  337. },
  338. _initContainer: function(container) {
  339. container = void 0 === container ? viewPortUtils.value() : container;
  340. var $element = this.$element();
  341. var $container = $element.closest(container);
  342. if (!$container.length) {
  343. $container = $(container).first()
  344. }
  345. this._$container = $container.length ? $container : $element.parent()
  346. },
  347. _initHideTopOverlayHandler: function(handler) {
  348. this._hideTopOverlayHandler = void 0 !== handler ? handler : this._defaultHideTopOverlayHandler.bind(this)
  349. },
  350. _defaultHideTopOverlayHandler: function() {
  351. this.hide()
  352. },
  353. _initActions: function() {
  354. this._actions = {};
  355. each(ACTIONS, function(_, action) {
  356. this._actions[action] = this._createActionByOption(action, {
  357. excludeValidators: ["disabled", "readOnly"]
  358. }) || noop
  359. }.bind(this))
  360. },
  361. _initCloseOnOutsideClickHandler: function() {
  362. var that = this;
  363. this._proxiedDocumentDownHandler = function() {
  364. return that._documentDownHandler.apply(that, arguments)
  365. }
  366. },
  367. _documentDownHandler: function(e) {
  368. if (this._showAnimationProcessing) {
  369. this._stopAnimation()
  370. }
  371. var closeOnOutsideClick = this.option("closeOnOutsideClick");
  372. if (typeUtils.isFunction(closeOnOutsideClick)) {
  373. closeOnOutsideClick = closeOnOutsideClick(e)
  374. }
  375. var $container = this._$content;
  376. var isAttachedTarget = $(window.document).is(e.target) || domUtils.contains(window.document, e.target);
  377. var isInnerOverlay = $(e.target).closest("." + INNER_OVERLAY_CLASS).length;
  378. var outsideClick = isAttachedTarget && !isInnerOverlay && !($container.is(e.target) || domUtils.contains($container.get(0), e.target));
  379. if (outsideClick && closeOnOutsideClick) {
  380. if (this.option("shading")) {
  381. e.preventDefault()
  382. }
  383. this.hide()
  384. }
  385. return this.option("propagateOutsideClick")
  386. },
  387. _initTemplates: function() {
  388. this.callBase();
  389. this._defaultTemplates.content = new EmptyTemplate(this)
  390. },
  391. _isTopOverlay: function() {
  392. var overlayStack = this._overlayStack();
  393. for (var i = overlayStack.length - 1; i >= 0; i--) {
  394. var tabbableElements = overlayStack[i]._findTabbableBounds();
  395. if (tabbableElements.first || tabbableElements.last) {
  396. return overlayStack[i] === this
  397. }
  398. }
  399. return false
  400. },
  401. _overlayStack: function() {
  402. return OVERLAY_STACK
  403. },
  404. _zIndexInitValue: function() {
  405. return Overlay.baseZIndex()
  406. },
  407. _toggleViewPortSubscription: function(toggle) {
  408. viewPortChanged.remove(this._viewPortChangeHandle);
  409. if (toggle) {
  410. this._viewPortChangeHandle = this._viewPortChangeHandler.bind(this);
  411. viewPortChanged.add(this._viewPortChangeHandle)
  412. }
  413. },
  414. _viewPortChangeHandler: function() {
  415. this._initContainer(this.option("container"));
  416. this._refresh()
  417. },
  418. _renderVisibilityAnimate: function(visible) {
  419. this._stopAnimation();
  420. return visible ? this._show() : this._hide()
  421. },
  422. _normalizePosition: function() {
  423. var position = this.option("position");
  424. this._position = "function" === typeof position ? position() : position
  425. },
  426. _getAnimationConfig: function() {
  427. var animation = this.option("animation");
  428. if (typeUtils.isFunction(animation)) {
  429. animation = animation.call(this)
  430. }
  431. return animation
  432. },
  433. _show: function() {
  434. var that = this;
  435. var deferred = new Deferred;
  436. this._parentHidden = this._isParentHidden();
  437. deferred.done(function() {
  438. delete that._parentHidden
  439. });
  440. if (this._parentHidden) {
  441. this._isHidden = true;
  442. return deferred.resolve()
  443. }
  444. if (this._currentVisible) {
  445. return (new Deferred).resolve().promise()
  446. }
  447. this._currentVisible = true;
  448. this._isShown = false;
  449. this._normalizePosition();
  450. var animation = that._getAnimationConfig() || {};
  451. var showAnimation = this._normalizeAnimation(animation.show, "to");
  452. var startShowAnimation = showAnimation && showAnimation.start || noop;
  453. var completeShowAnimation = showAnimation && showAnimation.complete || noop;
  454. if (this._isHidingActionCanceled) {
  455. delete this._isHidingActionCanceled;
  456. deferred.resolve()
  457. } else {
  458. var show = function() {
  459. this._renderVisibility(true);
  460. if (this._isShowingActionCanceled) {
  461. delete this._isShowingActionCanceled;
  462. deferred.resolve();
  463. return
  464. }
  465. this._animate(showAnimation, function() {
  466. if (that.option("focusStateEnabled")) {
  467. eventsEngine.trigger(that._focusTarget(), "focus")
  468. }
  469. completeShowAnimation.apply(this, arguments);
  470. that._showAnimationProcessing = false;
  471. that._isShown = true;
  472. that._actions.onShown();
  473. that._toggleSafariScrolling(false);
  474. deferred.resolve()
  475. }, function() {
  476. startShowAnimation.apply(this, arguments);
  477. that._showAnimationProcessing = true
  478. })
  479. }.bind(this);
  480. if (this.option("templatesRenderAsynchronously")) {
  481. this._stopShowTimer();
  482. this._asyncShowTimeout = setTimeout(show)
  483. } else {
  484. show()
  485. }
  486. }
  487. return deferred.promise()
  488. },
  489. _normalizeAnimation: function(animation, prop) {
  490. if (animation) {
  491. animation = extend({
  492. type: "slide"
  493. }, animation);
  494. if (animation[prop] && "object" === _typeof(animation[prop])) {
  495. extend(animation[prop], {
  496. position: this._position
  497. })
  498. }
  499. }
  500. return animation
  501. },
  502. _hide: function() {
  503. if (!this._currentVisible) {
  504. return (new Deferred).resolve().promise()
  505. }
  506. this._currentVisible = false;
  507. var that = this;
  508. var deferred = new Deferred;
  509. var animation = that._getAnimationConfig() || {};
  510. var hideAnimation = this._normalizeAnimation(animation.hide, "from");
  511. var startHideAnimation = hideAnimation && hideAnimation.start || noop;
  512. var completeHideAnimation = hideAnimation && hideAnimation.complete || noop;
  513. var hidingArgs = {
  514. cancel: false
  515. };
  516. if (this._isShowingActionCanceled) {
  517. deferred.resolve()
  518. } else {
  519. this._actions.onHiding(hidingArgs);
  520. that._toggleSafariScrolling(true);
  521. if (hidingArgs.cancel) {
  522. this._isHidingActionCanceled = true;
  523. this.option("visible", true);
  524. deferred.resolve()
  525. } else {
  526. this._forceFocusLost();
  527. this._toggleShading(false);
  528. this._toggleSubscriptions(false);
  529. this._stopShowTimer();
  530. this._animate(hideAnimation, function() {
  531. that._$content.css("pointerEvents", "");
  532. that._renderVisibility(false);
  533. completeHideAnimation.apply(this, arguments);
  534. that._actions.onHidden();
  535. deferred.resolve()
  536. }, function() {
  537. that._$content.css("pointerEvents", "none");
  538. startHideAnimation.apply(this, arguments)
  539. })
  540. }
  541. }
  542. return deferred.promise()
  543. },
  544. _forceFocusLost: function() {
  545. var activeElement = domAdapter.getActiveElement();
  546. var shouldResetActiveElement = !!this._$content.find(activeElement).length;
  547. if (shouldResetActiveElement) {
  548. domUtils.resetActiveElement()
  549. }
  550. },
  551. _animate: function(animation, completeCallback, startCallback) {
  552. if (animation) {
  553. startCallback = startCallback || animation.start || noop;
  554. fx.animate(this._$content, extend({}, animation, {
  555. start: startCallback,
  556. complete: completeCallback
  557. }))
  558. } else {
  559. completeCallback()
  560. }
  561. },
  562. _stopAnimation: function() {
  563. fx.stop(this._$content, true)
  564. },
  565. _renderVisibility: function(visible) {
  566. if (visible && this._isParentHidden()) {
  567. return
  568. }
  569. this._currentVisible = visible;
  570. this._stopAnimation();
  571. if (!visible) {
  572. domUtils.triggerHidingEvent(this._$content)
  573. }
  574. this._toggleVisibility(visible);
  575. this._$content.toggleClass(INVISIBLE_STATE_CLASS, !visible);
  576. this._updateZIndexStackPosition(visible);
  577. if (visible) {
  578. this._renderContent();
  579. var showingArgs = {
  580. cancel: false
  581. };
  582. this._actions.onShowing(showingArgs);
  583. if (showingArgs.cancel) {
  584. this._toggleVisibility(false);
  585. this._$content.toggleClass(INVISIBLE_STATE_CLASS, true);
  586. this._updateZIndexStackPosition(false);
  587. this._moveFromContainer();
  588. this._isShowingActionCanceled = true;
  589. this.option("visible", false);
  590. return
  591. }
  592. this._moveToContainer();
  593. this._renderGeometry();
  594. domUtils.triggerShownEvent(this._$content);
  595. domUtils.triggerResizeEvent(this._$content)
  596. } else {
  597. this._moveFromContainer()
  598. }
  599. this._toggleShading(visible);
  600. this._toggleSubscriptions(visible)
  601. },
  602. _updateZIndexStackPosition: function(pushToStack) {
  603. var overlayStack = this._overlayStack();
  604. var index = inArray(this, overlayStack);
  605. if (pushToStack) {
  606. if (index === -1) {
  607. this._zIndex = zIndexPool.create(this._zIndexInitValue());
  608. overlayStack.push(this)
  609. }
  610. this._$wrapper.css("zIndex", this._zIndex);
  611. this._$content.css("zIndex", this._zIndex)
  612. } else {
  613. if (index !== -1) {
  614. overlayStack.splice(index, 1);
  615. zIndexPool.remove(this._zIndex)
  616. }
  617. }
  618. },
  619. _toggleShading: function(visible) {
  620. this._$wrapper.toggleClass(OVERLAY_MODAL_CLASS, this.option("shading") && !this.option("container"));
  621. this._$wrapper.toggleClass(OVERLAY_SHADER_CLASS, visible && this.option("shading"));
  622. this._$wrapper.css("backgroundColor", this.option("shading") ? this.option("shadingColor") : "");
  623. this._toggleTabTerminator(visible && this.option("shading"))
  624. },
  625. _initTabTerminatorHandler: function() {
  626. var that = this;
  627. this._proxiedTabTerminatorHandler = function() {
  628. that._tabKeyHandler.apply(that, arguments)
  629. }
  630. },
  631. _toggleTabTerminator: function(enabled) {
  632. var eventName = eventUtils.addNamespace("keydown", this.NAME);
  633. if (enabled) {
  634. eventsEngine.on(domAdapter.getDocument(), eventName, this._proxiedTabTerminatorHandler)
  635. } else {
  636. eventsEngine.off(domAdapter.getDocument(), eventName, this._proxiedTabTerminatorHandler)
  637. }
  638. },
  639. _findTabbableBounds: function() {
  640. var $elements = this._$wrapper.find("*");
  641. var elementsCount = $elements.length - 1;
  642. var result = {
  643. first: null,
  644. last: null
  645. };
  646. for (var i = 0; i <= elementsCount; i++) {
  647. if (!result.first && $elements.eq(i).is(selectors.tabbable)) {
  648. result.first = $elements.eq(i)
  649. }
  650. if (!result.last && $elements.eq(elementsCount - i).is(selectors.tabbable)) {
  651. result.last = $elements.eq(elementsCount - i)
  652. }
  653. if (result.first && result.last) {
  654. break
  655. }
  656. }
  657. return result
  658. },
  659. _tabKeyHandler: function(e) {
  660. if (eventUtils.normalizeKeyName(e) !== TAB_KEY || !this._isTopOverlay()) {
  661. return
  662. }
  663. var tabbableElements = this._findTabbableBounds();
  664. var $firstTabbable = tabbableElements.first;
  665. var $lastTabbable = tabbableElements.last;
  666. var isTabOnLast = !e.shiftKey && e.target === $lastTabbable.get(0);
  667. var isShiftTabOnFirst = e.shiftKey && e.target === $firstTabbable.get(0);
  668. var isEmptyTabList = 0 === tabbableElements.length;
  669. var isOutsideTarget = !domUtils.contains(this._$wrapper.get(0), e.target);
  670. if (isTabOnLast || isShiftTabOnFirst || isEmptyTabList || isOutsideTarget) {
  671. e.preventDefault();
  672. var $focusElement = e.shiftKey ? $lastTabbable : $firstTabbable;
  673. eventsEngine.trigger($focusElement, "focusin");
  674. eventsEngine.trigger($focusElement, "focus")
  675. }
  676. },
  677. _toggleSubscriptions: function(enabled) {
  678. if (windowUtils.hasWindow()) {
  679. this._toggleHideTopOverlayCallback(enabled);
  680. this._toggleParentsScrollSubscription(enabled)
  681. }
  682. },
  683. _toggleHideTopOverlayCallback: function(subscribe) {
  684. if (!this._hideTopOverlayHandler) {
  685. return
  686. }
  687. if (subscribe && this.option("closeOnBackButton")) {
  688. hideTopOverlayCallback.add(this._hideTopOverlayHandler)
  689. } else {
  690. hideTopOverlayCallback.remove(this._hideTopOverlayHandler)
  691. }
  692. },
  693. _toggleParentsScrollSubscription: function(subscribe) {
  694. if (!this._position) {
  695. return
  696. }
  697. var target = this._position.of || $();
  698. var closeOnScroll = this.option("closeOnTargetScroll");
  699. var $parents = getElement(target).parents();
  700. var scrollEvent = eventUtils.addNamespace("scroll", this.NAME);
  701. if ("generic" === devices.real().platform) {
  702. $parents = $parents.add(window)
  703. }
  704. this._proxiedTargetParentsScrollHandler = this._proxiedTargetParentsScrollHandler || function(e) {
  705. this._targetParentsScrollHandler(e)
  706. }.bind(this);
  707. eventsEngine.off($().add(this._$prevTargetParents), scrollEvent, this._proxiedTargetParentsScrollHandler);
  708. if (subscribe && closeOnScroll) {
  709. eventsEngine.on($parents, scrollEvent, this._proxiedTargetParentsScrollHandler);
  710. this._$prevTargetParents = $parents
  711. }
  712. },
  713. _targetParentsScrollHandler: function(e) {
  714. var closeHandled = false;
  715. var closeOnScroll = this.option("closeOnTargetScroll");
  716. if (typeUtils.isFunction(closeOnScroll)) {
  717. closeHandled = closeOnScroll(e)
  718. }
  719. if (!closeHandled && !this._showAnimationProcessing) {
  720. this.hide()
  721. }
  722. },
  723. _render: function() {
  724. this.callBase();
  725. this._appendContentToElement();
  726. this._renderVisibilityAnimate(this.option("visible"))
  727. },
  728. _appendContentToElement: function() {
  729. if (!this._$content.parent().is(this.$element())) {
  730. this._$content.appendTo(this.$element())
  731. }
  732. },
  733. _renderContent: function() {
  734. var shouldDeferRendering = !this._currentVisible && this.option("deferRendering");
  735. var isParentHidden = this.option("visible") && this._isParentHidden();
  736. if (isParentHidden) {
  737. this._isHidden = true;
  738. return
  739. }
  740. if (this._contentAlreadyRendered || shouldDeferRendering) {
  741. return
  742. }
  743. this._contentAlreadyRendered = true;
  744. this._appendContentToElement();
  745. this.callBase()
  746. },
  747. _isParentHidden: function() {
  748. if (!this.option("_checkParentVisibility")) {
  749. return false
  750. }
  751. if (void 0 !== this._parentHidden) {
  752. return this._parentHidden
  753. }
  754. var $parent = this.$element().parent();
  755. if ($parent.is(":visible")) {
  756. return false
  757. }
  758. var isHidden = false;
  759. $parent.add($parent.parents()).each(function() {
  760. var $element = $(this);
  761. if ("none" === $element.css("display")) {
  762. isHidden = true;
  763. return false
  764. }
  765. });
  766. return isHidden || !domAdapter.getBody().contains($parent.get(0))
  767. },
  768. _renderContentImpl: function() {
  769. var _this = this;
  770. var whenContentRendered = new Deferred;
  771. var contentTemplateOption = this.option("contentTemplate");
  772. var contentTemplate = this._getTemplate(contentTemplateOption);
  773. var transclude = this._getAnonymousTemplateName() === contentTemplateOption;
  774. contentTemplate && contentTemplate.render({
  775. container: getPublicElement(this.$content()),
  776. noModel: true,
  777. transclude: transclude,
  778. onRendered: function() {
  779. whenContentRendered.resolve()
  780. }
  781. });
  782. this._renderDrag();
  783. this._renderResize();
  784. this._renderScrollTerminator();
  785. whenContentRendered.done(function() {
  786. if (_this.option("visible")) {
  787. _this._moveToContainer()
  788. }
  789. });
  790. return whenContentRendered.promise()
  791. },
  792. _renderDrag: function() {
  793. var $dragTarget = this._getDragTarget();
  794. if (!$dragTarget) {
  795. return
  796. }
  797. var startEventName = eventUtils.addNamespace(dragEvents.start, this.NAME);
  798. var updateEventName = eventUtils.addNamespace(dragEvents.move, this.NAME);
  799. eventsEngine.off($dragTarget, startEventName);
  800. eventsEngine.off($dragTarget, updateEventName);
  801. if (!this.option("dragEnabled")) {
  802. return
  803. }
  804. eventsEngine.on($dragTarget, startEventName, this._dragStartHandler.bind(this));
  805. eventsEngine.on($dragTarget, updateEventName, this._dragUpdateHandler.bind(this))
  806. },
  807. _renderResize: function() {
  808. this._resizable = this._createComponent(this._$content, Resizable, {
  809. handles: this.option("resizeEnabled") ? "all" : "none",
  810. onResizeEnd: this._resizeEndHandler.bind(this),
  811. onResize: this._actions.onResize.bind(this),
  812. onResizeStart: this._actions.onResizeStart.bind(this),
  813. minHeight: 100,
  814. minWidth: 100,
  815. area: this._getDragResizeContainer()
  816. })
  817. },
  818. _resizeEndHandler: function() {
  819. this._positionChangeHandled = true;
  820. var width = this._resizable.option("width");
  821. var height = this._resizable.option("height");
  822. width && this.option("width", width);
  823. height && this.option("height", height);
  824. this._actions.onResizeEnd()
  825. },
  826. _renderScrollTerminator: function() {
  827. var $scrollTerminator = this._wrapper();
  828. var terminatorEventName = eventUtils.addNamespace(dragEvents.move, this.NAME);
  829. eventsEngine.off($scrollTerminator, terminatorEventName);
  830. eventsEngine.on($scrollTerminator, terminatorEventName, {
  831. validate: function() {
  832. return true
  833. },
  834. getDirection: function() {
  835. return "both"
  836. },
  837. _toggleGestureCover: function(toggle) {
  838. if (!toggle) {
  839. this._toggleGestureCoverImpl(toggle)
  840. }
  841. },
  842. _clearSelection: noop,
  843. isNative: true
  844. }, function(e) {
  845. var originalEvent = e.originalEvent.originalEvent;
  846. e._cancelPreventDefault = true;
  847. if (originalEvent && "mousemove" !== originalEvent.type) {
  848. e.preventDefault()
  849. }
  850. })
  851. },
  852. _getDragTarget: function() {
  853. return this.$content()
  854. },
  855. _dragStartHandler: function(e) {
  856. e.targetElements = [];
  857. this._prevOffset = {
  858. x: 0,
  859. y: 0
  860. };
  861. var allowedOffsets = this._allowedOffsets();
  862. e.maxTopOffset = allowedOffsets.top;
  863. e.maxBottomOffset = allowedOffsets.bottom;
  864. e.maxLeftOffset = allowedOffsets.left;
  865. e.maxRightOffset = allowedOffsets.right
  866. },
  867. _getDragResizeContainer: function() {
  868. var isContainerDefined = viewPortUtils.originalViewPort().get(0) || this.option("container");
  869. var $container = !isContainerDefined ? $(window) : this._$container;
  870. return $container
  871. },
  872. _deltaSize: function() {
  873. var $content = this._$content;
  874. var $container = this._getDragResizeContainer();
  875. var contentWidth = $content.outerWidth();
  876. var contentHeight = $content.outerHeight();
  877. var containerWidth = $container.outerWidth();
  878. var containerHeight = $container.outerHeight();
  879. if (this._isWindow($container)) {
  880. var document = domAdapter.getDocument();
  881. var fullPageHeight = Math.max($(document).outerHeight(), containerHeight);
  882. var fullPageWidth = Math.max($(document).outerWidth(), containerWidth);
  883. containerHeight = fullPageHeight;
  884. containerWidth = fullPageWidth
  885. }
  886. return {
  887. width: containerWidth - contentWidth,
  888. height: containerHeight - contentHeight
  889. }
  890. },
  891. _dragUpdateHandler: function(e) {
  892. var offset = e.offset;
  893. var prevOffset = this._prevOffset;
  894. var targetOffset = {
  895. top: offset.y - prevOffset.y,
  896. left: offset.x - prevOffset.x
  897. };
  898. this._changePosition(targetOffset);
  899. this._prevOffset = offset
  900. },
  901. _changePosition: function(offset) {
  902. var position = translator.locate(this._$content);
  903. translator.move(this._$content, {
  904. left: position.left + offset.left,
  905. top: position.top + offset.top
  906. });
  907. this._positionChangeHandled = true
  908. },
  909. _allowedOffsets: function() {
  910. var position = translator.locate(this._$content);
  911. var deltaSize = this._deltaSize();
  912. var isAllowedDrag = deltaSize.height >= 0 && deltaSize.width >= 0;
  913. var shaderOffset = this.option("shading") && !this.option("container") && !this._isWindow(this._getContainer()) ? translator.locate(this._$wrapper) : {
  914. top: 0,
  915. left: 0
  916. };
  917. var boundaryOffset = this.option("boundaryOffset");
  918. return {
  919. top: isAllowedDrag ? position.top + shaderOffset.top + boundaryOffset.v : 0,
  920. bottom: isAllowedDrag ? -position.top - shaderOffset.top + deltaSize.height - boundaryOffset.v : 0,
  921. left: isAllowedDrag ? position.left + shaderOffset.left + boundaryOffset.h : 0,
  922. right: isAllowedDrag ? -position.left - shaderOffset.left + deltaSize.width - boundaryOffset.h : 0
  923. }
  924. },
  925. _moveFromContainer: function() {
  926. this._$content.appendTo(this.$element());
  927. this._detachWrapperToContainer()
  928. },
  929. _detachWrapperToContainer: function() {
  930. this._$wrapper.detach()
  931. },
  932. _moveToContainer: function() {
  933. this._attachWrapperToContainer();
  934. this._$content.appendTo(this._$wrapper)
  935. },
  936. _attachWrapperToContainer: function() {
  937. var $element = this.$element();
  938. var containerDefined = void 0 !== this.option("container");
  939. var renderContainer = containerDefined ? this._$container : swatch.getSwatchContainer($element);
  940. if (renderContainer && renderContainer[0] === $element.parent()[0]) {
  941. renderContainer = $element
  942. }
  943. this._$wrapper.appendTo(renderContainer)
  944. },
  945. _fixHeightAfterSafariAddressBarResizing: function() {
  946. if (this._isWindow(this._getContainer()) && hasSafariAddressBar) {
  947. this._$wrapper.css("minHeight", window.innerHeight)
  948. }
  949. },
  950. _renderGeometry: function(isDimensionChanged) {
  951. if (this.option("visible") && windowUtils.hasWindow()) {
  952. this._renderGeometryImpl(isDimensionChanged)
  953. }
  954. },
  955. _renderGeometryImpl: function(isDimensionChanged) {
  956. this._stopAnimation();
  957. this._normalizePosition();
  958. this._renderShading();
  959. this._fixHeightAfterSafariAddressBarResizing();
  960. this._renderDimensions();
  961. var resultPosition = this._renderPosition();
  962. this._actions.onPositioned({
  963. position: resultPosition
  964. })
  965. },
  966. _fixWrapperPosition: function() {
  967. this._$wrapper.css("position", this._useFixedPosition() ? "fixed" : "absolute")
  968. },
  969. _useFixedPosition: function() {
  970. var $container = this._getContainer();
  971. return this._isWindow($container) && (!iOS || void 0 !== this._bodyScrollTop)
  972. },
  973. _toggleSafariScrolling: function(scrollingEnabled) {
  974. if (iOS && this._useFixedPosition()) {
  975. var body = domAdapter.getBody();
  976. if (scrollingEnabled) {
  977. $(body).removeClass(PREVENT_SAFARI_SCROLLING_CLASS);
  978. window.scrollTo(0, this._bodyScrollTop);
  979. this._bodyScrollTop = void 0
  980. } else {
  981. if (this.option("visible")) {
  982. this._bodyScrollTop = window.pageYOffset;
  983. $(body).addClass(PREVENT_SAFARI_SCROLLING_CLASS)
  984. }
  985. }
  986. }
  987. },
  988. _renderShading: function() {
  989. this._fixWrapperPosition();
  990. this._renderShadingDimensions();
  991. this._renderShadingPosition()
  992. },
  993. _renderShadingPosition: function() {
  994. if (this.option("shading")) {
  995. var $container = this._getContainer();
  996. positionUtils.setup(this._$wrapper, {
  997. my: "top left",
  998. at: "top left",
  999. of: $container
  1000. })
  1001. }
  1002. },
  1003. _renderShadingDimensions: function() {
  1004. var wrapperWidth;
  1005. var wrapperHeight;
  1006. if (this.option("shading")) {
  1007. var $container = this._getContainer();
  1008. wrapperWidth = this._isWindow($container) ? "100%" : $container.outerWidth(), wrapperHeight = this._isWindow($container) ? "100%" : $container.outerHeight()
  1009. } else {
  1010. wrapperWidth = "";
  1011. wrapperHeight = ""
  1012. }
  1013. this._$wrapper.css({
  1014. width: wrapperWidth,
  1015. height: wrapperHeight
  1016. })
  1017. },
  1018. _isWindow: function($element) {
  1019. return !!$element && typeUtils.isWindow($element.get(0))
  1020. },
  1021. _getContainer: function() {
  1022. var position = this._position;
  1023. var container = this.option("container");
  1024. var positionOf = position ? position.of || window : null;
  1025. return getElement(container || positionOf)
  1026. },
  1027. _renderDimensions: function() {
  1028. var content = this._$content.get(0);
  1029. this._$content.css({
  1030. minWidth: this._getOptionValue("minWidth", content),
  1031. maxWidth: this._getOptionValue("maxWidth", content),
  1032. minHeight: this._getOptionValue("minHeight", content),
  1033. maxHeight: this._getOptionValue("maxHeight", content),
  1034. width: this._getOptionValue("width", content),
  1035. height: this._getOptionValue("height", content)
  1036. })
  1037. },
  1038. _renderPosition: function() {
  1039. if (this._positionChangeHandled) {
  1040. var allowedOffsets = this._allowedOffsets();
  1041. this._changePosition({
  1042. top: fitIntoRange(0, -allowedOffsets.top, allowedOffsets.bottom),
  1043. left: fitIntoRange(0, -allowedOffsets.left, allowedOffsets.right)
  1044. })
  1045. } else {
  1046. this._renderOverlayBoundaryOffset();
  1047. translator.resetPosition(this._$content);
  1048. var position = this._transformStringPosition(this._position, POSITION_ALIASES);
  1049. var resultPosition = positionUtils.setup(this._$content, position);
  1050. forceRepaint(this._$content);
  1051. this._actions.onPositioning();
  1052. return resultPosition
  1053. }
  1054. },
  1055. _transformStringPosition: function(position, positionAliases) {
  1056. if (typeUtils.isString(position)) {
  1057. position = extend({}, positionAliases[position])
  1058. }
  1059. return position
  1060. },
  1061. _renderOverlayBoundaryOffset: function() {
  1062. var boundaryOffset = this.option("boundaryOffset");
  1063. this._$content.css("margin", boundaryOffset.v + "px " + boundaryOffset.h + "px")
  1064. },
  1065. _focusTarget: function() {
  1066. return this._$content
  1067. },
  1068. _attachKeyboardEvents: function() {
  1069. this._keyboardProcessor = new KeyboardProcessor({
  1070. element: this._$content,
  1071. handler: this._keyboardHandler,
  1072. context: this
  1073. })
  1074. },
  1075. _keyboardHandler: function(options) {
  1076. var e = options.originalEvent;
  1077. var $target = $(e.target);
  1078. if ($target.is(this._$content) || !this.option("ignoreChildEvents")) {
  1079. this.callBase.apply(this, arguments)
  1080. }
  1081. },
  1082. _isVisible: function() {
  1083. return this.option("visible")
  1084. },
  1085. _visibilityChanged: function(visible) {
  1086. if (visible) {
  1087. if (this.option("visible")) {
  1088. this._renderVisibilityAnimate(visible)
  1089. }
  1090. } else {
  1091. this._renderVisibilityAnimate(visible)
  1092. }
  1093. },
  1094. _dimensionChanged: function() {
  1095. this._renderGeometry(true)
  1096. },
  1097. _clean: function() {
  1098. if (!this._contentAlreadyRendered) {
  1099. this.$content().empty()
  1100. }
  1101. this._renderVisibility(false);
  1102. this._stopShowTimer();
  1103. this._cleanFocusState()
  1104. },
  1105. _stopShowTimer: function() {
  1106. if (this._asyncShowTimeout) {
  1107. clearTimeout(this._asyncShowTimeout)
  1108. }
  1109. this._asyncShowTimeout = null
  1110. },
  1111. _dispose: function() {
  1112. fx.stop(this._$content, false);
  1113. clearTimeout(this._deferShowTimer);
  1114. this._toggleViewPortSubscription(false);
  1115. this._toggleSubscriptions(false);
  1116. this._updateZIndexStackPosition(false);
  1117. this._toggleTabTerminator(false);
  1118. this._toggleSafariScrolling(true);
  1119. this._actions = null;
  1120. this.callBase();
  1121. zIndexPool.remove(this._zIndex);
  1122. this._$wrapper.remove();
  1123. this._$content.remove()
  1124. },
  1125. _toggleDisabledState: function(value) {
  1126. this.callBase.apply(this, arguments);
  1127. this._$content.toggleClass(DISABLED_STATE_CLASS, Boolean(value))
  1128. },
  1129. _toggleRTLDirection: function(rtl) {
  1130. this._$content.toggleClass(RTL_DIRECTION_CLASS, rtl)
  1131. },
  1132. _optionChanged: function(args) {
  1133. var value = args.value;
  1134. if (inArray(args.name, ACTIONS) > -1) {
  1135. this._initActions();
  1136. return
  1137. }
  1138. switch (args.name) {
  1139. case "dragEnabled":
  1140. this._renderDrag();
  1141. this._renderGeometry();
  1142. break;
  1143. case "resizeEnabled":
  1144. this._renderResize();
  1145. this._renderGeometry();
  1146. break;
  1147. case "shading":
  1148. case "shadingColor":
  1149. this._toggleShading(this.option("visible"));
  1150. break;
  1151. case "width":
  1152. case "height":
  1153. case "minWidth":
  1154. case "maxWidth":
  1155. case "minHeight":
  1156. case "maxHeight":
  1157. case "boundaryOffset":
  1158. this._renderGeometry();
  1159. break;
  1160. case "position":
  1161. this._positionChangeHandled = false;
  1162. this._renderGeometry();
  1163. break;
  1164. case "visible":
  1165. this._renderVisibilityAnimate(value).done(function() {
  1166. if (!this._animateDeferred) {
  1167. return
  1168. }
  1169. this._animateDeferred.resolveWith(this)
  1170. }.bind(this));
  1171. break;
  1172. case "target":
  1173. this._initTarget(value);
  1174. this._invalidate();
  1175. break;
  1176. case "container":
  1177. this._initContainer(value);
  1178. this._invalidate();
  1179. break;
  1180. case "innerOverlay":
  1181. this._initInnerOverlayClass();
  1182. break;
  1183. case "deferRendering":
  1184. case "contentTemplate":
  1185. this._contentAlreadyRendered = false;
  1186. this._clean();
  1187. this._invalidate();
  1188. break;
  1189. case "closeOnBackButton":
  1190. this._toggleHideTopOverlayCallback(this.option("visible"));
  1191. break;
  1192. case "closeOnTargetScroll":
  1193. this._toggleParentsScrollSubscription(this.option("visible"));
  1194. break;
  1195. case "closeOnOutsideClick":
  1196. case "animation":
  1197. case "propagateOutsideClick":
  1198. break;
  1199. case "rtlEnabled":
  1200. this._contentAlreadyRendered = false;
  1201. this.option("visible", false);
  1202. this.callBase(args);
  1203. break;
  1204. default:
  1205. this.callBase(args)
  1206. }
  1207. },
  1208. toggle: function(showing) {
  1209. showing = void 0 === showing ? !this.option("visible") : showing;
  1210. if (showing === this.option("visible")) {
  1211. return (new Deferred).resolve().promise()
  1212. }
  1213. var animateDeferred = new Deferred;
  1214. this._animateDeferred = animateDeferred;
  1215. this.option("visible", showing);
  1216. return animateDeferred.promise().done(function() {
  1217. delete this._animateDeferred
  1218. }.bind(this))
  1219. },
  1220. $content: function() {
  1221. return this._$content
  1222. },
  1223. show: function() {
  1224. return this.toggle(true)
  1225. },
  1226. hide: function() {
  1227. return this.toggle(false)
  1228. },
  1229. content: function() {
  1230. return getPublicElement(this._$content)
  1231. },
  1232. repaint: function() {
  1233. this._renderGeometry();
  1234. domUtils.triggerResizeEvent(this._$content)
  1235. }
  1236. });
  1237. Overlay.baseZIndex = function(zIndex) {
  1238. return zIndexPool.base(zIndex)
  1239. };
  1240. registerComponent("dxOverlay", Overlay);
  1241. module.exports = Overlay;