* Added check if remove() method exists in a prototype's constructor
* Fixed bug that caused exception when calling Layout.reset() due to undefined main skin of a third-party prototype (e.g. Feed)
This commit is contained in:
parent
271e48eaa9
commit
dff39778a6
2 changed files with 11 additions and 3 deletions
|
@ -115,8 +115,10 @@ HopObject.remove = function(collection) {
|
||||||
var item;
|
var item;
|
||||||
while (collection.size() > 0) {
|
while (collection.size() > 0) {
|
||||||
item = collection.get(0);
|
item = collection.get(0);
|
||||||
|
if (item.constructor.remove) {
|
||||||
item.constructor.remove.call(item, item);
|
item.constructor.remove.call(item, item);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -229,6 +229,9 @@ Skin.prototype.setSource = function(source) {
|
||||||
res.writeln(source.trim());
|
res.writeln(source.trim());
|
||||||
}
|
}
|
||||||
var skin = this.getMainSkin();
|
var skin = this.getMainSkin();
|
||||||
|
if (!skin) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var subskins = skin.getSubskinNames();
|
var subskins = skin.getSubskinNames();
|
||||||
for (var i in subskins) {
|
for (var i in subskins) {
|
||||||
if (subskins[i] !== this.name) {
|
if (subskins[i] !== this.name) {
|
||||||
|
@ -262,8 +265,11 @@ Skin.prototype.getStaticFile = function(fpath, skin) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Skin.prototype.getMainSkin = function() {
|
Skin.prototype.getMainSkin = function() {
|
||||||
var source = app.getSkinfilesInPath(res.skinpath)[this.prototype][this.prototype];
|
var skinSet = app.getSkinfilesInPath(res.skinpath)[this.prototype];
|
||||||
return createSkin(source);
|
if (skinSet && skinSet[this.prototype]) {
|
||||||
|
return createSkin(skinSet[this.prototype]);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Skin.prototype.custom_macro = function() {
|
Skin.prototype.custom_macro = function() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue