Allow string path to be passed to Zotero.File.getExtension()
This commit is contained in:
parent
47b934f67e
commit
2f47eae3ff
1 changed files with 1 additions and 0 deletions
|
@ -77,6 +77,7 @@ Zotero.File = new function(){
|
||||||
}
|
}
|
||||||
|
|
||||||
function getExtension(file){
|
function getExtension(file){
|
||||||
|
file = this.pathToFile(file);
|
||||||
var pos = file.leafName.lastIndexOf('.');
|
var pos = file.leafName.lastIndexOf('.');
|
||||||
return pos==-1 ? '' : file.leafName.substr(pos+1);
|
return pos==-1 ? '' : file.leafName.substr(pos+1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue