Created
September 14, 2012 22:48
-
-
Save gabrielhpugliese/3725454 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Nomes = new Meteor.Collection("nomes"); | |
Nome = { | |
remove : function(nome) { | |
return Nomes.remove({ | |
nome : nome | |
}); | |
}, | |
get : function(nome) { | |
return Nomes.findOne({ | |
nome : nome | |
}); | |
}, | |
set : function(nome) { | |
return Nomes.insert({ | |
nome : nome | |
}); | |
} | |
}; | |
window.onbeforeunload = function(e) { | |
var message = "Your confirmation message goes here."; | |
var nome = Session.get('nome'); | |
Nome.remove(nome); | |
Meteor.flush(); | |
return message; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment