Loading app/assets/javascripts/weight_select.js.coffee 0 → 100644 +12 −0 Original line number Original line Diff line number Diff line class @WeightSelect constructor: -> $('.js-weight-select').each (i, dropdown) -> $(dropdown).glDropdown( selectable: true fieldName: $(dropdown).data("field-name") id: (obj, el) -> $(el).data "id" clicked: -> if $(dropdown).is ".js-filter-submit" $(dropdown).parents('form').submit() ) app/views/shared/issuable/_filter.html.haml +10 −3 Original line number Original line Diff line number Diff line Loading @@ -81,9 +81,15 @@ - if controller.controller_name == 'issues' - if controller.controller_name == 'issues' .filter-item.inline.weight-filter .filter-item.inline.weight-filter = select_tag('weight', issues_weight_options(edit: false), - if params[:weight] class: 'select2 trigger-submit', include_blank: true, = hidden_field_tag(:weight, params[:weight]) data: {placeholder: 'Weight'}) = dropdown_tag("Weight", options: { title: "Filter by weight", toggle_class: 'js-weight-select js-filter-submit', dropdown_class: "dropdown-menu-selectable", placeholder: "Search weight", data: { field_name: "weight" } }) do %ul - Issue.weight_options.each do |weight| %li %a{href: "#", data: { id: weight }, class: ("is-active" if params[:weight] == weight.to_s)} = weight .pull-right .pull-right = render 'shared/sort_dropdown' = render 'shared/sort_dropdown' Loading Loading @@ -118,6 +124,7 @@ new LabelsSelect(); new LabelsSelect(); new MilestoneSelect(); new MilestoneSelect(); new IssueStatusSelect(); new IssueStatusSelect(); new WeightSelect(); $('form.filter-form').on('submit', function (event) { $('form.filter-form').on('submit', function (event) { event.preventDefault(); event.preventDefault(); Turbolinks.visit(this.action + '&' + $(this).serialize()); Turbolinks.visit(this.action + '&' + $(this).serialize()); Loading Loading
app/assets/javascripts/weight_select.js.coffee 0 → 100644 +12 −0 Original line number Original line Diff line number Diff line class @WeightSelect constructor: -> $('.js-weight-select').each (i, dropdown) -> $(dropdown).glDropdown( selectable: true fieldName: $(dropdown).data("field-name") id: (obj, el) -> $(el).data "id" clicked: -> if $(dropdown).is ".js-filter-submit" $(dropdown).parents('form').submit() )
app/views/shared/issuable/_filter.html.haml +10 −3 Original line number Original line Diff line number Diff line Loading @@ -81,9 +81,15 @@ - if controller.controller_name == 'issues' - if controller.controller_name == 'issues' .filter-item.inline.weight-filter .filter-item.inline.weight-filter = select_tag('weight', issues_weight_options(edit: false), - if params[:weight] class: 'select2 trigger-submit', include_blank: true, = hidden_field_tag(:weight, params[:weight]) data: {placeholder: 'Weight'}) = dropdown_tag("Weight", options: { title: "Filter by weight", toggle_class: 'js-weight-select js-filter-submit', dropdown_class: "dropdown-menu-selectable", placeholder: "Search weight", data: { field_name: "weight" } }) do %ul - Issue.weight_options.each do |weight| %li %a{href: "#", data: { id: weight }, class: ("is-active" if params[:weight] == weight.to_s)} = weight .pull-right .pull-right = render 'shared/sort_dropdown' = render 'shared/sort_dropdown' Loading Loading @@ -118,6 +124,7 @@ new LabelsSelect(); new LabelsSelect(); new MilestoneSelect(); new MilestoneSelect(); new IssueStatusSelect(); new IssueStatusSelect(); new WeightSelect(); $('form.filter-form').on('submit', function (event) { $('form.filter-form').on('submit', function (event) { event.preventDefault(); event.preventDefault(); Turbolinks.visit(this.action + '&' + $(this).serialize()); Turbolinks.visit(this.action + '&' + $(this).serialize()); Loading