Add Zotero.localeCompare
Can be used directly in Array.sort() as the sorting function. Uses LocaleCollateion.compareString internally
This commit is contained in:
parent
9700cdde38
commit
a56e800d7c
1 changed files with 6 additions and 0 deletions
|
@ -1531,6 +1531,12 @@ Components.utils.import("resource://gre/modules/osfile.jsm");
|
|||
};
|
||||
}
|
||||
|
||||
this.defineProperty(this, "localeCompare", {
|
||||
get: function() {
|
||||
var collation = this.getLocaleCollation();
|
||||
return collation.compareString.bind(collation, 1);
|
||||
}
|
||||
}, {lazy: true});
|
||||
|
||||
/*
|
||||
* Sets font size based on prefs -- intended for use on root element
|
||||
|
|
Loading…
Reference in a new issue