2015-08-10 17:11:27 -04:00
|
|
|
import DiscourseURL from 'discourse/lib/url';
|
|
|
|
|
2015-08-11 12:27:07 -04:00
|
|
|
export default Ember.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")
|
|
|
|
|
|
|
|
});
|