mirror of
https://github.com/discourse/discourse.git
synced 2024-12-16 08:33:45 +08:00
26 lines
654 B
JavaScript
26 lines
654 B
JavaScript
import DiscourseURL from 'discourse/lib/url';
|
|
|
|
export default Ember.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);
|
|
}
|
|
|
|
DiscourseURL.redirectTo($link.data("href"));
|
|
});
|
|
}.on("didInsertElement"),
|
|
|
|
_removeBindings: function() {
|
|
this.$().off("mouseup.admin-backups");
|
|
}.on("willDestroyElement")
|
|
|
|
});
|