Skip to content

Commit

Permalink
LS-39764 - [#LS-39764] Resolve qooxdoo 7.5 compile and runtime warnings
Browse files Browse the repository at this point in the history
Solves warning:

Native.js:56 032572 : The method 'qx.html.Node.prototype._applyProperty()' is deprecated: The method '_applyProperty' is deprecated.  Please use `registerProperty` instead (property 'repeat' in qx.html.Image)
a fix on issue:
LWEB-183-enable-image-to-be-set-through-theme
  • Loading branch information
rijckrocket committed Nov 29, 2023
1 parent e61b973 commit e3e6f07
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
20 changes: 17 additions & 3 deletions source/class/qx/html/Image.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ qx.Class.define("qx.html.Image", {
);

this.registerProperty("scale", null, this._setScaleProperty);
this.registerProperty("repeat", null, this._setRepeatProperty); //LS-39764 - Resolve qooxdoo 7.5 compile and runtime warnings
},

/*
Expand Down Expand Up @@ -109,7 +110,7 @@ qx.Class.define("qx.html.Image", {

var source = this._getProperty("source");
var scale = this._getProperty("scale");
var repeat = scale ? "scale" : this._getProperty("repeat") || "no-repeat"; //LWEB-183-enable-image-to-be-set-through-theme
var repeat = scale ? "scale" : this.getRepeat() || "no-repeat"; //LWEB-183-enable-image-to-be-set-through-theme //LS-39764 - Resolve qooxdoo 7.5 compile and runtime warnings

// Source can be null in certain circumstances.
// See bug #3701 for details.
Expand Down Expand Up @@ -149,7 +150,7 @@ qx.Class.define("qx.html.Image", {
// overridden
_createDomElement() {
var scale = this._getProperty("scale");
var repeat = scale ? "scale" : this._getProperty("repeat") || "no-repeat"; //LWEB-183-enable-image-to-be-set-through-theme
var repeat = scale ? "scale" : this.getRepeat() || "no-repeat"; //LWEB-183-enable-image-to-be-set-through-theme //LS-39764 - Resolve qooxdoo 7.5 compile and runtime warnings

if (qx.core.Environment.get("engine.name") == "mshtml") {
var source = this._getProperty("source");
Expand Down Expand Up @@ -220,7 +221,7 @@ qx.Class.define("qx.html.Image", {
* Whether the image should be scaled or not.
*
* @param value {Boolean} Scale the image
* @return {qx.html.Label} This instance for for chaining support.
* @return {qx.html.Label} This instance for chaining support.
*/
setScale(value) {
this._setProperty("scale", value);
Expand All @@ -234,6 +235,19 @@ qx.Class.define("qx.html.Image", {
*/
getScale() {
return this._getProperty("scale");
},

setRepeat(value) { //LS-39764 - Resolve qooxdoo 7.5 compile and runtime warnings
this._setProperty("repeat", value);
return this;
},

getRepeat() { //LS-39764 - Resolve qooxdoo 7.5 compile and runtime warnings
return this._getProperty("repeat");
},

_setRepeatProperty(value) { //LS-39764 - Resolve qooxdoo 7.5 compile and runtime warnings
// Nothing
}
}
});
4 changes: 2 additions & 2 deletions source/class/qx/ui/basic/Image.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ qx.Class.define("qx.ui.basic.Image", {
_applyScale(value) {
//LWEB-183-enable-image-to-be-set-through-theme
if(this.getSource()) {
this._styleSource();
this._styleSource();
}
},

Expand Down Expand Up @@ -548,7 +548,7 @@ qx.Class.define("qx.ui.basic.Image", {
this.__loadUnmanagedImage(contentEl, source);
}
if(!this.getScale()) { //LWEB-183-enable-image-to-be-set-through-theme
contentEl._setProperty("repeat", this.getRepeat());
contentEl.setRepeat(this.getRepeat()); //LS-39764 - Resolve qooxdoo 7.5 compile and runtime warnings
}
},

Expand Down

0 comments on commit e3e6f07

Please sign in to comment.