add: function(options) { if (!options.id || this.list[options.id]) { Galaxy.emit.debug("form-repeat::add()", "Duplicate or invalid repeat block id."); return; } var button_delete = new Ui.Button({ icon: "fa-trash-o", tooltip: _l("Delete this repeat block"), cls: "ui-button-icon-plain form-repeat-delete", onclick: function() { if (options.ondel) { options.ondel(); } } }); var portlet = new Portlet.View({ id: options.id, title: _l("placeholder"), cls: options.cls || "ui-portlet-section", operations: { button_delete: button_delete } }); portlet.append(options.$el); portlet.$el.addClass("section-row").hide(); this.list[options.id] = portlet; this.$list.append(portlet.$el.fadeIn("fast")); if (this.options.max > 0 && this.size() >= this.options.max) { this.button_new.disable(); } this._refresh(); },
_addSection: function(input_def) { var portlet = new Portlet.View({ title: input_def.title || input_def.name, cls: "ui-portlet-section", collapsible: true, collapsible_button: true, collapsed: !input_def.expanded }); portlet.append(new View(this.app, { inputs: input_def.inputs }).$el); portlet.append( $("<div/>") .addClass("ui-form-info") .html(input_def.help) ); this.app.on("expand", input_id => { portlet.$(`#${input_id}`).length > 0 && portlet.expand(); }); this._append(portlet.$el, input_def.id); },
this.app.on("expand", input_id => { portlet.$(`#${input_id}`).length > 0 && portlet.expand(); });