Client formatting

This commit is contained in:
Dannon Baker
2018-03-27 12:34:59 -04:00
parent 8b5c0b223e
commit 0cdd9b9ecd
11 changed files with 27 additions and 37 deletions
+4 -10
View File
@@ -101,14 +101,11 @@ window.app = function app(options, bootstrapped) {
var model = new UserPreferences.Model({
user_id: Galaxy.params.id
});
this.page.display(new FormWrapper.View(_.extend(
model.get(form_id),
{active_tab: "user"}
)));
this.page.display(new FormWrapper.View(_.extend(model.get(form_id), { active_tab: "user" })));
},
show_visualizations: function(action_id) {
var activeTab = action_id=="list_published"?"shared":"visualization";
var activeTab = action_id == "list_published" ? "shared" : "visualization";
this.page.display(
new GridShared.View({
action_id: action_id,
@@ -207,7 +204,7 @@ window.app = function app(options, bootstrapped) {
},
show_pages: function(action_id) {
var activeTab = action_id=="list_published"?"shared":"user";
var activeTab = action_id == "list_published" ? "shared" : "user";
this.page.display(
new GridShared.View({
action_id: action_id,
@@ -330,10 +327,7 @@ window.app = function app(options, bootstrapped) {
Utils.get({
url: `${Galaxy.root}api/workflows/${Utils.getQueryString("id")}/download?style=run`,
success: response => {
this.page.display(new ToolFormComposite.View(_.extend(
response,
{active_tab: "workflow"}
)));
this.page.display(new ToolFormComposite.View(_.extend(response, { active_tab: "workflow" })));
},
error: response => {
var error_msg = response.err_msg || "Error occurred while loading the resource.";
@@ -133,4 +133,4 @@ export default {
float: left;
margin-top:10px;
}
</style>
</style>
+4 -3
View File
@@ -285,7 +285,8 @@ var Collection = Backbone.Collection.extend({
title: _l("Saved Pages"),
url: "pages/list",
target: "_top"
},{
},
{
title: _l("Saved Visualizations"),
url: "visualizations/list",
target: "_top"
@@ -343,13 +344,13 @@ var Tab = Backbone.View.extend({
.attr("title", this.model.get("tooltip"))
.tooltip("destroy");
this.model.get("tooltip") && this.$toggle.tooltip({ placement: "bottom" });
if(!this.model.get("menu")){
if (!this.model.get("menu")) {
this.$dropdown
.removeClass()
.addClass("dropdown")
.addClass(this.model.get("disabled") && "disabled")
.addClass(this.model.get("active") && "active");
};
}
if (this.model.get("menu") && this.model.get("show_menu")) {
this.$menu.show();
$("#dd-helper")
@@ -6,7 +6,7 @@ var View = Backbone.View.extend({
this.model = new Backbone.Model(options);
this.url = this.model.get("url");
this.redirect = this.model.get("redirect");
if (options && options.active_tab){
if (options && options.active_tab) {
this.active_tab = options.active_tab;
}
this.setElement("<div/>");
@@ -9,7 +9,7 @@ var View = Backbone.View.extend({
this.model = new Backbone.Model(options);
this.item = this.model.get("item");
this.title = this.model.get("plural");
if (options && options.active_tab){
if (options && options.active_tab) {
this.active_tab = options.active_tab;
}
$.ajax({
@@ -107,10 +107,9 @@ var View = Backbone.View.extend({
var self = this;
LoadingIndicator.markViewAsLoading(this);
if(options.action_id == "list_published"){
if (options.action_id == "list_published") {
this.active_tab = "shared";
}
else if (options.action_id = "list"){
} else if ((options.action_id = "list")) {
this.active_tab = "user";
}
this.model = new Backbone.Model();
@@ -15,7 +15,7 @@ var View = Backbone.View.extend({
this.modal = parent.Galaxy.modal || new Modal.View();
this.model = (options && options.model) || new Backbone.Model(options);
this.deferred = new Deferred();
if (options && options.active_tab){
if (options && options.active_tab) {
this.active_tab = options.active_tab;
}
this.setElement(
@@ -303,17 +303,17 @@ var View = Backbone.View.extend({
});
this._append(this.$steps, this.history_form.$el);
},
/** Render Workflow Options */
_renderResourceParameters: function() {
this.workflow_resource_parameters_form = null;
if(!_.isEmpty(this.model.get('workflow_resource_parameters'))){
if (!_.isEmpty(this.model.get("workflow_resource_parameters"))) {
this.workflow_resource_parameters_form = new Form({
cls : 'ui-portlet-narrow',
title : '<b>Workflow Resource Options</b>',
inputs : this.model.get('workflow_resource_parameters')
cls: "ui-portlet-narrow",
title: "<b>Workflow Resource Options</b>",
inputs: this.model.get("workflow_resource_parameters")
});
this._append( this.$steps, this.workflow_resource_parameters_form.$el );
this._append(this.$steps, this.workflow_resource_parameters_form.$el);
}
},
@@ -538,7 +538,9 @@ var View = Backbone.View.extend({
var job_def = {
new_history_name: history_form_data["new_history|name"] ? history_form_data["new_history|name"] : null,
history_id: !history_form_data["new_history|name"] ? this.model.get("history_id") : null,
resource_params: this.workflow_resource_parameters_form ? this.workflow_resource_parameters_form.data.create() : {},
resource_params: this.workflow_resource_parameters_form
? this.workflow_resource_parameters_form.data.create()
: {},
replacement_params: this.wp_form ? this.wp_form.data.create() : {},
parameters: {},
// Tool form will submit flat maps for each parameter
+1 -1
View File
@@ -15,7 +15,7 @@ var ButtonDefault = Backbone.View.extend({
wait_cls: "btn btn-info",
disabled: false,
percentage: -1,
visible: true,
visible: true
}).set(options);
this.setElement(
$("<button/>")
+1 -1
View File
@@ -47,7 +47,7 @@ export var Message = Backbone.View.extend({
fade: true
}).set(options);
this.listenTo(this.model, "change", this.render, this);
if (options && options.active_tab){
if (options && options.active_tab) {
this.active_tab = options.active_tab;
}
this.render();
@@ -122,13 +122,7 @@ export default Backbone.View.extend({
}
}
});
this.buttons = [
this.left_button,
this.right_button,
this.execute_button,
this.export_button,
this.save_button
];
this.buttons = [this.left_button, this.right_button, this.execute_button, this.export_button, this.save_button];
this.setElement("<div/>");
for (let b of this.buttons) {
this.$el.append(b.$el);
@@ -26,7 +26,7 @@ export default Backbone.View.extend({
this._fullscreen(this.$el, 20);
this._createContainer("div");
this.chart.on("redraw", function(confirmed) {
if (!self.chart.get("modified") || !self.chart.plugin.specs.confirm || confirmed ) {
if (!self.chart.get("modified") || !self.chart.plugin.specs.confirm || confirmed) {
self.app.deferred.execute(function(process) {
console.debug("viewer:redraw() - Redrawing...");
self._draw(process, self.chart);