Skip to content

Commit

Permalink
[BUG #8514] added disconnectFromWidget method to the layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
danielwagner committed Aug 22, 2014
1 parent fcb48f8 commit cc69004
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
8 changes: 6 additions & 2 deletions framework/source/class/qx/ui/mobile/core/Widget.js
Expand Up @@ -484,8 +484,7 @@ qx.Bootstrap.define("qx.ui.mobile.core.Widget",
* @param layout {qx.ui.mobile.layout.Abstract} The new layout or
* <code>null</code> to reset the layout.
*/
_setLayout : function(layout)
{
_setLayout : function(layout) {
if (qx.core.Environment.get("qx.debug")) {
if (layout) {
qx.core.Assert.assertInstance(layout, qx.ui.mobile.layout.Abstract);
Expand All @@ -494,6 +493,11 @@ qx.Bootstrap.define("qx.ui.mobile.core.Widget",

if (layout) {
layout.connectToWidget(this);
} else {
var oldLayout = this.getLayout();
if (oldLayout) {
oldLayout.disconnectFromWidget(this);
}
}

this.__layoutManager = layout;
Expand Down
15 changes: 15 additions & 0 deletions framework/source/class/qx/ui/mobile/layout/Abstract.js
Expand Up @@ -155,6 +155,21 @@ qx.Bootstrap.define("qx.ui.mobile.layout.Abstract",
},


/**
* This method is called by the widget to disconnect the widget from
* the layout.
*
* @param widget {qx.ui.mobile.core.Widget} The widget to disconnect from
*/
disconnectFromWidget : function(widget)
{
if (this._widget) {
this._widget.removeClasses(this._getCssClasses());
this._widget = null;
}
},



/**
* Connects the layout to a given child widget. Can be overridden in a concrete
Expand Down

0 comments on commit cc69004

Please sign in to comment.