All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rwt.widgets.util.IframeManager.js Maven / Gradle / Ivy

Go to download

The Rich Ajax Platform lets you build rich, Ajax-enabled Web applications.

There is a newer version: 3.29.0
Show newest version
/*******************************************************************************
 *  Copyright: 2004, 2012 1&1 Internet AG, Germany, http://www.1und1.de,
 *                        and EclipseSource
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this
 * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
 *
 *  Contributors:
 *    1&1 Internet AG and others - original API and implementation
 *    EclipseSource - adaptation for the Eclipse Rich Ajax Platform
 ******************************************************************************/

/**
 * This singleton manages multiple instances of rwt.widgets.base.Iframe.
 * 

* The problem: When dragging over an iframe then all mouse events will be * passed to the document of the iframe, not the main document. *

* The solution: In order to be able to track mouse events over iframes, this * manager will block all iframes during a drag with a glasspane. */ rwt.qx.Class.define("rwt.widgets.util.IframeManager", { type : "singleton", extend : rwt.util.ObjectManager, /* ***************************************************************************** CONSTRUCTOR ***************************************************************************** */ construct : function() { this.base(arguments); this._blocked = {}; }, /* ***************************************************************************** MEMBERS ***************************************************************************** */ members : { /* --------------------------------------------------------------------------- METHODS --------------------------------------------------------------------------- */ /** * TODOC * * @type member * @param evt {Event} TODOC * @return {void} */ handleMouseDown : function(evt) { var iframeMap = this._blockData = rwt.util.Objects.copy(this.getAll()); // console.debug("Blocking frames: " + rwt.util.Objects.getLength(iframeMap)); for (var key in iframeMap) { iframeMap[key].block(); } }, /** * TODOC * * @type member * @param evt {Event} TODOC * @return {void} */ handleMouseUp : function(evt) { var iframeMap = this._blockData; // console.debug("Releasing frames: " + rwt.util.Objects.getLength(iframeMap)); for (var key in iframeMap) { iframeMap[key].release(); } } }, /* --------------------------------------------------------------------------- DESTRUCTOR --------------------------------------------------------------------------- */ destruct : function() { this._disposeFields("_blocked", "_blockData"); } });





© 2015 - 2024 Weber Informatics LLC | Privacy Policy