Browse Source

Merge pull request 'WIP:add selected all and clear all' (#181) from benchmark-cate into develop

Reviewed-by: yuyuanshifu <747342561@qq.com>
tags/1.13.6
yuyuanshifu 4 years ago
parent
commit
0df39624c4
1 changed files with 21 additions and 1 deletions
  1. +21
    -1
      templates/repo/cloudbrain/new.tmpl

+ 21
- 1
templates/repo/cloudbrain/new.tmpl View File

@@ -131,8 +131,12 @@
<option value="{{.Value}}">{{.Value}}</option> <option value="{{.Value}}">{{.Value}}</option>
{{end}} {{end}}
</select> </select>
<div class="mini ui buttons" style="vertical-align: top; margin-top:9px">
<button class="ui button reset">重置</button>
<div class="or"></div>
<button class="ui positive button active all_selected">全选</button>
</div>
</div> </div>

<input id="store_category" type="hidden" name="get_benchmark_category"> <input id="store_category" type="hidden" name="get_benchmark_category">


<div class="inline required field"> <div class="inline required field">
@@ -216,6 +220,22 @@
$('select.dropdown') $('select.dropdown')
.dropdown(); .dropdown();


$(".ui.button.reset").click(function(e){
e.preventDefault()
$('#cloudbrain_benchmark_category')
.dropdown("clear", true)
})

$(".ui.positive.button.active.all_selected").click(function(e){
e.preventDefault()
var selected_value = new Array()
$("#cloudbrain_benchmark_category option").each(function(){
selected_value.push($(this).val())
});
$('#cloudbrain_benchmark_category')
.dropdown("set exactly", selected_value)
})

$(function() { $(function() {
$("#cloudbrain_job_type").change(function() { $("#cloudbrain_job_type").change(function() {
if ($(this).val() == 'BENCHMARK') { if ($(this).val() == 'BENCHMARK') {


Loading…
Cancel
Save