Add timeout to hide epics table options

stable
Xavier Julián 2016-09-22 16:18:20 +02:00 committed by David Barragán Merino
parent fffc140898
commit a3a7b868ba
3 changed files with 23 additions and 4 deletions

View File

@ -23,10 +23,11 @@ taiga = @.taiga
class EpicsTableController
@.$inject = [
"$tgConfirm",
"tgEpicsService"
"tgEpicsService",
"$timeout"
]
constructor: (@confirm, @epicsService) ->
constructor: (@confirm, @epicsService, @timeout) ->
@.displayOptions = false
@.displayVotes = true
@.column = {
@ -49,4 +50,11 @@ class EpicsTableController
.then null, () => # on error
@confirm.notify("error")
hoverEpicTableOption: () ->
if @.timer
@timeout.cancel(@.timer)
hideEpicTableOption: () ->
return @.timer = @timeout (=> @.displayOptions = false), 400
angular.module("taigaEpics").controller("EpicsTableCtrl", EpicsTableController)

View File

@ -40,11 +40,16 @@ mixin epicSwitch(name, model)
translate="EPICS.TABLE.PROGRESS"
ng-if="vm.column.progress"
)
.epics-table-options-wrapper(ng-mouseleave="vm.displayOptions = false")
.epics-table-options-wrapper(
ng-mouseleave="vm.hideEpicTableOption()"
)
button.epics-table-option-button.e2e-epics-column-button(ng-click="vm.displayOptions = true")
span(translate="EPICS.TABLE.VIEW_OPTIONS")
tg-svg(svg-icon="icon-arrow-down")
form.epics-table-dropdown.e2e-epics-column-dropdown(ng-show="vm.displayOptions")
form.epics-table-dropdown.e2e-epics-column-dropdown(
ng-show="vm.displayOptions"
ng-mouseenter="vm.keepEpicTableOption()"
)
.fieldset
label.epics-table-options-vote(
translate="EPICS.TABLE.VOTES"

View File

@ -44,6 +44,12 @@
top: 1.3rem;
width: 250px;
z-index: 99;
&.ng-hide-remove {
animation: dropdownFade .2s;
}
&.ng-hide-add {
animation: dropdownFade .2s reverse;
}
.fieldset {
@include font-size(small);
border-bottom: 1px solid $whitish;