Avoid errors from elements without box object
This commit is contained in:
parent
a8d490f468
commit
d2d68a6437
@ -144,10 +144,10 @@ BrowserUIShowHideObserver.prototype = {
|
|||||||
serializeBoxState : function BrowserUIShowHideObserver_serializeBoxState(aElement)
|
serializeBoxState : function BrowserUIShowHideObserver_serializeBoxState(aElement)
|
||||||
{
|
{
|
||||||
aElement = aElement || this.box;
|
aElement = aElement || this.box;
|
||||||
var box = aElement.boxObject;
|
var box = aElement.boxObject || {}; // Some times there is no boxObject (ex. HTML element)
|
||||||
return JSON.stringify({
|
return JSON.stringify({
|
||||||
width : box.width,
|
width : box.width || 0,
|
||||||
height : box.height,
|
height : box.height || 0,
|
||||||
hidden : Boolean(aElement.hidden),
|
hidden : Boolean(aElement.hidden),
|
||||||
collapsed : Boolean(aElement.collapsed)
|
collapsed : Boolean(aElement.collapsed)
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user