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

26 lines
654 B
Plaintext
Raw Normal View History

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