Deal with non-existent style attributes, and returning calculated pixel widths as a fallback.
This commit is contained in:
parent
fa41027264
commit
c5d6cb1327
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
@ -605,6 +605,7 @@
|
||||
return this.opts.width;
|
||||
|
||||
var style = this.opts.element.attr('style');
|
||||
if(style !== undefined){
|
||||
var attrs = style.split(';');
|
||||
for (var i = 0; i < attrs.length; i++) {
|
||||
var matches = attrs[i].replace(/\s/g,'')
|
||||
@ -612,7 +613,8 @@
|
||||
if(matches != null && matches.length >= 1)
|
||||
return matches[1];
|
||||
}
|
||||
return this.opts.element.width();
|
||||
}
|
||||
return this.opts.element.width() + 'px';
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user