have you looked into CoffeeScript? it's slightly more pythonic than JavaScript.
I haven't had the time to try it yet, but maybe it'll suit your needs ;)
self.$popup = $('#' + containerId).addClass('pop-up').mouseout(def():
self.hide()
)