Show confirmation lightbox before remove a custom filter
parent
c54cb8b243
commit
a11221834a
|
@ -451,11 +451,14 @@ IssuesDirective = ($log, $location) ->
|
||||||
|
|
||||||
return {link:link}
|
return {link:link}
|
||||||
|
|
||||||
|
module.directive("tgIssues", ["$log", "$tgLocation", IssuesDirective])
|
||||||
|
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
## Issues Filters Directive
|
## Issues Filters Directive
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
IssuesFiltersDirective = ($log, $location, $rs) ->
|
IssuesFiltersDirective = ($log, $location, $rs, $confirm) ->
|
||||||
template = _.template("""
|
template = _.template("""
|
||||||
<% _.each(filters, function(f) { %>
|
<% _.each(filters, function(f) { %>
|
||||||
<% if (!f.selected) { %>
|
<% if (!f.selected) { %>
|
||||||
|
@ -623,11 +626,17 @@ IssuesFiltersDirective = ($log, $location, $rs) ->
|
||||||
$el.on "click", ".filter-list .single-filter .icon-delete", (event) ->
|
$el.on "click", ".filter-list .single-filter .icon-delete", (event) ->
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
|
|
||||||
target = angular.element(event.currentTarget)
|
target = angular.element(event.currentTarget)
|
||||||
$ctrl.deleteMyFilter(target.parent().data('id')).then ->
|
customFilterName = target.parent().data('id')
|
||||||
$ctrl.loadMyFilters().then (filters) ->
|
title = "Delete custom filter" # TODO: i18n
|
||||||
$scope.filters.myFilters = filters
|
subtitle = "the custom filter '#{customFilterName}'" # TODO: i18n
|
||||||
renderFilters($scope.filters.myFilters)
|
|
||||||
|
$confirm.ask(title, subtitle).then ->
|
||||||
|
$ctrl.deleteMyFilter(customFilterName).then ->
|
||||||
|
$ctrl.loadMyFilters().then (filters) ->
|
||||||
|
$scope.filters.myFilters = filters
|
||||||
|
renderFilters($scope.filters.myFilters)
|
||||||
|
|
||||||
$el.on "click", ".save-filters", (event) ->
|
$el.on "click", ".save-filters", (event) ->
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
|
@ -659,8 +668,8 @@ IssuesFiltersDirective = ($log, $location, $rs) ->
|
||||||
|
|
||||||
return {link:link}
|
return {link:link}
|
||||||
|
|
||||||
module.directive("tgIssuesFilters", ["$log", "$tgLocation", "$tgResources", IssuesFiltersDirective])
|
module.directive("tgIssuesFilters", ["$log", "$tgLocation", "$tgResources", "$tgConfirm",
|
||||||
module.directive("tgIssues", ["$log", "$tgLocation", IssuesDirective])
|
IssuesFiltersDirective])
|
||||||
|
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
@ -735,10 +744,6 @@ IssueStatusInlineEditionDirective = ($repo, popoverService) ->
|
||||||
module.directive("tgIssueStatusInlineEdition", ["$tgRepo", IssueStatusInlineEditionDirective])
|
module.directive("tgIssueStatusInlineEdition", ["$tgRepo", IssueStatusInlineEditionDirective])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
## Issue assigned to Directive
|
## Issue assigned to Directive
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
Loading…
Reference in New Issue