Skip to content

Commit

Permalink
Merge pull request #6 from desilinguist/hotfix/keys-function-in-chrome
Browse files Browse the repository at this point in the history
Fix incompatibility with latest Chrome.
  • Loading branch information
desilinguist committed Jan 27, 2016
2 parents 178df66 + ada54aa commit c280639
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bleu.html
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@

// build the doc plot strip of plots if there is more
// than one document otherwise we don't need to
var numDocuments = keys(scontainer.documentScores).length;
var numDocuments = Object.keys(scontainer.documentScores).length;
if ( numDocuments > 0) {

// Set the height and width for the container
Expand Down
8 changes: 1 addition & 7 deletions js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,10 @@ jQuery.fn.compare = function(other) {
return true;
};

// Utility function to get all keys for a hash
keys = function(o) {
var ret=[],p;
for(p in o) if(Object.prototype.hasOwnProperty.call(o,p)) ret.push(p);
return ret;
};

// Utility function to check whether two hashes are equal
function hashequal(me, other) {
if (!$(keys(me)).compare(keys(other))) { return false; }
if (!$(Object.keys(me)).compare(Object.keys(other))) { return false; }
for (var key in me) {
if (me[key] != other[key]) {
return false;
Expand Down

0 comments on commit c280639

Please sign in to comment.