2015-08-11 05:11:27 +08:00
|
|
|
import DiscourseURL from 'discourse/lib/url';
|
|
|
|
|
2015-08-12 00:27:07 +08:00
|
|
|
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")
|
|
|
|
|
|
|
|
});
|