Skip to content
Snippets Groups Projects
Commit fc585e4f authored by Piotr Gawron's avatar Piotr Gawron
Browse files

user can remove overlays

parent 1851398e
No related branches found
No related tags found
2 merge requests!115Resolve "admin panel should use API",!114Resolve "admin panel should use API"
...@@ -305,6 +305,15 @@ EditProjectDialog.prototype._createOverlayTable = function() { ...@@ -305,6 +305,15 @@ EditProjectDialog.prototype._createOverlayTable = function() {
}); });
}); });
$(overlaysTable).on("click", "[name='downloadSource']", function() {
var button = this;
return ServerConnector.getOverlaySourceDownloadUrl({
overlayId : $(button).attr("data")
}).then(function(url) {
return self.downloadFile(url);
}).then(null, GuiConnector.alert);
});
return overlaysTable; return overlaysTable;
}; };
...@@ -327,13 +336,18 @@ EditProjectDialog.prototype.createUsersTabContent = function() { ...@@ -327,13 +336,18 @@ EditProjectDialog.prototype.createUsersTabContent = function() {
}; };
EditProjectDialog.prototype.init = function() { EditProjectDialog.prototype.init = function() {
var self = this;
return self.refreshOverlays().then(function() {
$(window).trigger('resize');
});
};
EditProjectDialog.prototype.refreshOverlays = function() {
var self = this; var self = this;
return ServerConnector.getOverlays({ return ServerConnector.getOverlays({
projectId : self.getProject().getProjectId() projectId : self.getProject().getProjectId()
}).then(function(overlays) { }).then(function(overlays) {
return self.setOverlays(overlays); return self.setOverlays(overlays);
}).then(function() {
$(window).trigger('resize');
}); });
}; };
...@@ -460,5 +474,13 @@ EditProjectDialog.prototype.saveOverlay = function(overlayId) { ...@@ -460,5 +474,13 @@ EditProjectDialog.prototype.saveOverlay = function(overlayId) {
return ServerConnector.updateOverlay(overlay); return ServerConnector.updateOverlay(overlay);
}; };
EditProjectDialog.prototype.removeOverlay = function(overlayId) {
var self = this;
return ServerConnector.removeOverlay({
overlayId : overlayId
}).then(function() {
return self.refreshOverlays();
});
};
module.exports = EditProjectDialog; module.exports = EditProjectDialog;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment