discourse/app/assets/javascripts/admin/views/admin-backups.js.es6

26 lines
658 B
Text
Raw Normal View History

2015-08-10 17:11:27 -04:00
import DiscourseURL from 'discourse/lib/url';
export default Discourse.View.extend({
2014-02-12 23:35:46 -05:00
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);
}
2015-08-10 17:11:27 -04:00
DiscourseURL.redirectTo($link.data("href"));
2014-02-12 23:35:46 -05:00
});
}.on("didInsertElement"),
_removeBindings: function() {
this.$().off("mouseup.admin-backups");
}.on("willDestroyElement")
});