Skip to content

Commit

Permalink
Fix problem with initially attached Commands
Browse files Browse the repository at this point in the history
  • Loading branch information
cajus committed Jan 25, 2017
1 parent d7f58a2 commit b5e822d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
20 changes: 14 additions & 6 deletions framework/source/class/qx/ui/core/MExecutable.js
Expand Up @@ -117,13 +117,15 @@ qx.Mixin.define("qx.ui.core.MExecutable",
* @param e {qx.event.type.Event} The execute event of the command.
*/
__onCommandExecute : function(e) {
if (this.__semaphore) {
this.__semaphore = false;
return;
}
if (this.isEnabled()) {
this.__semaphore = true;
this.execute();
if (this.__semaphore) {
this.__semaphore = false;
return;
}
if (this.isEnabled()) {
this.__semaphore = true;
this.execute();
}
}
},

Expand Down Expand Up @@ -151,6 +153,11 @@ qx.Mixin.define("qx.ui.core.MExecutable",
for (var i = 0; i < this._bindableProperties.length; i++) {
var property = this._bindableProperties[i];

// Skip "enabled"
if (property === "enabled") {
continue;
}

// remove the old binding
if (old != null && !old.isDisposed() && ids[property] != null)
{
Expand All @@ -167,6 +174,7 @@ qx.Mixin.define("qx.ui.core.MExecutable",
// check also for themed values [BUG #5906]
if (selfPropertyValue == null) {
// update the appearance to make sure every themed property is up to date
this.$$resyncNeeded = true;
this.syncAppearance();
selfPropertyValue = qx.util.PropertyUtil.getThemeValue(
this, property
Expand Down
8 changes: 8 additions & 0 deletions framework/source/class/qx/ui/core/Widget.js
Expand Up @@ -3619,6 +3619,14 @@ qx.Class.define("qx.ui.core.Widget",
}
}

// If the appearance is already synced after the child control
// we need to update the appearance now, because the selector
// might be not correct in certain cases.
if (control.$$resyncNeeded) {
delete control.$$resyncNeeded;
control.updateAppearance();
}

this.fireDataEvent("createChildControl", control);

// Register control and return
Expand Down

0 comments on commit b5e822d

Please sign in to comment.