www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit a56e800d7cf0a2c8487a425455a6f13697f97a7d
parent 9700cdde387b28678e3e9cf085b5fa44ce2da4ac
Author: Aurimas Vinckevicius <aurimas.dev@gmail.com>
Date:   Fri, 14 Nov 2014 02:54:53 -0600

Add Zotero.localeCompare
Can be used directly in Array.sort() as the sorting function.
Uses LocaleCollateion.compareString internally

Diffstat:
Mchrome/content/zotero/xpcom/zotero.js | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js @@ -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