discourse/app/assets/javascripts/admin/views/admin-backups.js.es6
2015-02-24 13:47:46 -05:00

24 lines
612 B
JavaScript

export default Discourse.View.extend({
classNames: ["admin-backups"],
_hijackDownloads: function() {
this.$().on("mouseup.admin-backups", "a.download", function (e) {
var $link = $(e.currentTarget);
if (!$link.data("href")) {
$link.addClass("no-href");
$link.data("href", $link.attr("href"));
$link.attr("href", null);
$link.data("auto-route", true);
}
Discourse.URL.redirectTo($link.data("href"));
});
}.on("didInsertElement"),
_removeBindings: function() {
this.$().off("mouseup.admin-backups");
}.on("willDestroyElement")
});