From cf8b8902b48df007c074f04b3b31386d3fbe181d Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 5 Jan 2018 09:15:59 +0800 Subject: [PATCH] * code for task #3579. --- module/todo/css/create.css | 1 + module/todo/css/edit.css | 1 + module/todo/js/batchcreate.js | 8 ++++---- module/todo/js/common.js | 13 +++++++++---- module/todo/js/create.js | 1 + module/todo/view/batchcreate.html.php | 14 +++++++------- module/todo/view/batchedit.html.php | 6 +++--- module/todo/view/create.html.php | 6 +++--- module/todo/view/edit.html.php | 6 +++--- 9 files changed, 32 insertions(+), 24 deletions(-) create mode 100644 module/todo/css/create.css create mode 100644 module/todo/css/edit.css diff --git a/module/todo/css/create.css b/module/todo/css/create.css new file mode 100644 index 0000000000..71c2d8c97b --- /dev/null +++ b/module/todo/css/create.css @@ -0,0 +1 @@ +#begin_chosen{width:50% !important;} diff --git a/module/todo/css/edit.css b/module/todo/css/edit.css new file mode 100644 index 0000000000..71c2d8c97b --- /dev/null +++ b/module/todo/css/edit.css @@ -0,0 +1 @@ +#begin_chosen{width:50% !important;} diff --git a/module/todo/js/batchcreate.js b/module/todo/js/batchcreate.js index a0e22a5f00..31feb94146 100644 --- a/module/todo/js/batchcreate.js +++ b/module/todo/js/batchcreate.js @@ -17,12 +17,12 @@ function switchDateList(number) { if($('#switchDate' + number).attr('checked') == 'checked') { - $('#begins' + number).attr('disabled', 'disabled'); - $('#ends' + number).attr('disabled', 'disabled'); + $('#begins' + number).attr('disabled', 'disabled').trigger('chosen:updated'); + $('#ends' + number).attr('disabled', 'disabled').trigger('chosen:updated'); } else { - $('#begins' + number).removeAttr('disabled'); - $('#ends' + number).removeAttr('disabled'); + $('#begins' + number).removeAttr('disabled').trigger('chosen:updated'); + $('#ends' + number).removeAttr('disabled').trigger('chosen:updated'); } } diff --git a/module/todo/js/common.js b/module/todo/js/common.js index 956e2254ff..a9c90ecc98 100644 --- a/module/todo/js/common.js +++ b/module/todo/js/common.js @@ -62,6 +62,7 @@ function loadList(type, id) function selectNext() { $("#end ")[0].selectedIndex = $("#begin ")[0].selectedIndex + 3; + $('#end').trigger('chosen:updated'); } function setBeginsAndEnds(i, beginOrEnd) @@ -72,6 +73,7 @@ function setBeginsAndEnds(i, beginOrEnd) { if(j != 0) $("#begins" + j)[0].selectedIndex = $("#ends" + (j - 1))[0].selectedIndex; $("#ends" + j)[0].selectedIndex = $("#begins" + j)[0].selectedIndex + 3; + $("#ends" + j).trigger('chosen:updated'); } } else @@ -79,11 +81,14 @@ function setBeginsAndEnds(i, beginOrEnd) if(beginOrEnd == 'begin') { $("#ends" + i)[0].selectedIndex = $("#begins" + i)[0].selectedIndex + 3; + $("#ends" + j).trigger('chosen:updated'); } for(j = i+1; j < batchCreateNum; j++) { $("#begins" + j)[0].selectedIndex = $("#ends" + (j - 1))[0].selectedIndex; $("#ends" + j)[0].selectedIndex = $("#begins" + j)[0].selectedIndex + 3; + $("#begins" + j).trigger('chosen:updated'); + $("#ends" + j).trigger('chosen:updated'); } } } @@ -92,12 +97,12 @@ function switchDateFeature(switcher) { if(switcher.checked) { - $('#begin').attr('disabled','disabled'); - $('#end').attr('disabled','disabled'); + $('#begin').attr('disabled','disabled').trigger('chosen:updated'); + $('#end').attr('disabled','disabled').trigger('chosen:updated'); } else { - $('#begin').removeAttr('disabled'); - $('#end').removeAttr('disabled'); + $('#begin').removeAttr('disabled').trigger('chosen:updated'); + $('#end').removeAttr('disabled').trigger('chosen:updated'); } } diff --git a/module/todo/js/create.js b/module/todo/js/create.js index 5022d01b81..91a2c08398 100644 --- a/module/todo/js/create.js +++ b/module/todo/js/create.js @@ -5,6 +5,7 @@ $(function() { var selectTime = $(this).val() != today ? start : nowTime; $('#begin').val(selectTime); + $('#begin').trigger("chosen:updated"); selectNext(); }) diff --git a/module/todo/view/batchcreate.html.php b/module/todo/view/batchcreate.html.php index f7eaa180e4..12f4634d41 100755 --- a/module/todo/view/batchcreate.html.php +++ b/module/todo/view/batchcreate.html.php @@ -40,7 +40,7 @@ idAB;?> '>todo->type;?> - '>todo->pri;?> + '>todo->pri;?> todo->name;?> >todo->desc;?> '>todo->beginAndEnd;?> @@ -49,20 +49,20 @@ todo->batchCreate; $i++):?> - + - >todo->typeList, '', "onchange='loadList(this.value, " . ($i + 1) . ")' class='form-control'");?> - >todo->priList, $pri, 'class=form-control');?> + style='overflow:visible'>todo->typeList, '', "onchange='loadList(this.value, " . ($i + 1) . ")' class='form-control chosen'");?> + style='overflow:visible'>todo->priList, $pri, "class='form-control chosen'");?>
> - > + style='overflow:visible'>
todo->periods['future'];?>
diff --git a/module/todo/view/batchedit.html.php b/module/todo/view/batchedit.html.php index 4c110d1d25..a90d738a6b 100644 --- a/module/todo/view/batchedit.html.php +++ b/module/todo/view/batchedit.html.php @@ -38,7 +38,7 @@ $columns = count($visibleFields) + 3; idAB;?> todo->date;?> - todo->type;?> + todo->type;?> '> todo->pri;?> todo->name;?> >todo->desc;?> @@ -48,10 +48,10 @@ $columns = count($visibleFields) + 3; - + id . html::hidden("todoIDList[$todo->id]", $todo->id);?> id]", $todo->date, "class='form-control form-date'");?> - todo->typeList, $todo->type);?> + todo->typeList, $todo->type);?> >id]", $lang->todo->priList, $todo->pri, "class='form-control chosen'");?> diff --git a/module/todo/view/create.html.php b/module/todo/view/create.html.php index d1b1990e24..275b239f0c 100644 --- a/module/todo/view/create.html.php +++ b/module/todo/view/create.html.php @@ -82,7 +82,7 @@ todo->pri;?> - todo->priList, '', "class='form-control'");?> + todo->priList, '', "class='form-control chosen'");?> todo->name;?> @@ -97,13 +97,13 @@ todo->status;?> - todo->statusList, '', "class='form-control'");?> + todo->statusList, '', "class='form-control chosen'");?> todo->beginAndEnd;?>
- +
todo->lblDisableDate;?> diff --git a/module/todo/view/edit.html.php b/module/todo/view/edit.html.php index 502f296b44..6400f5e992 100644 --- a/module/todo/view/edit.html.php +++ b/module/todo/view/edit.html.php @@ -87,7 +87,7 @@ todo->pri;?> - todo->priList, $todo->pri, "class='form-control'");?> + todo->priList, $todo->pri, "class='form-control chosen'");?> todo->name;?> @@ -105,13 +105,13 @@ todo->status;?> - todo->statusList, $todo->status, "class='form-control'");?> + todo->statusList, $todo->status, "class='form-control chosen'");?> todo->beginAndEnd;?>
- begin, 'onchange=selectNext(); class="form-control" style="width: 50%"') . html::select('end', $times, $todo->end, 'class="form-control" style="width: 50%"');?> + begin, 'onchange=selectNext(); class="form-control chosen" style="width: 50%"') . html::select('end', $times, $todo->end, 'class="form-control chosen" style="width: 50%"');?>